mirror of
https://github.com/revoltchat/revite.git
synced 2024-12-26 07:22:10 -05:00
Fix: Fixed detail element in friends list
This commit is contained in:
parent
e94d824bb2
commit
652736c300
3 changed files with 37 additions and 12 deletions
|
@ -39,12 +39,10 @@ export default function CollapsibleSection({ id, defaultValue, summary, children
|
||||||
onToggle={e => setState(e.currentTarget.open)}
|
onToggle={e => setState(e.currentTarget.open)}
|
||||||
{...detailsProps}>
|
{...detailsProps}>
|
||||||
<summary>
|
<summary>
|
||||||
|
<div class="padding">
|
||||||
<ChevronDown size={20} />
|
<ChevronDown size={20} />
|
||||||
{ summary }
|
{ summary }
|
||||||
{/*<Overline type="subtle" className="overline">*/}
|
</div>
|
||||||
{/*<div className="title">*/}
|
|
||||||
{/*</div>*/}
|
|
||||||
{/*</Overline>*/}
|
|
||||||
</summary>
|
</summary>
|
||||||
{ children }
|
{ children }
|
||||||
</Details>
|
</Details>
|
||||||
|
|
|
@ -9,25 +9,52 @@ export default styled.details<{ sticky?: boolean, large?: boolean }>`
|
||||||
` }
|
` }
|
||||||
|
|
||||||
${ props => props.large && css`
|
${ props => props.large && css`
|
||||||
|
/*padding: 5px 0;*/
|
||||||
|
background: var(--primary-background);
|
||||||
|
color: var(--secondary-foreground);
|
||||||
|
|
||||||
|
.padding { /*TOFIX: make this applicable only for the friends list menu, DO NOT REMOVE.*/
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
padding: 5px 0;
|
padding: 5px 0;
|
||||||
|
margin: 0.8em 0px 0.4em;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
` }
|
` }
|
||||||
|
|
||||||
outline: none;
|
outline: none;
|
||||||
display: flex;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
transition: .2s opacity;
|
transition: .2s opacity;
|
||||||
|
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
text-transform: uppercase;
|
||||||
|
|
||||||
&::marker, &::-webkit-details-marker {
|
&::marker, &::-webkit-details-marker {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
flex-grow: 1;
|
||||||
|
margin-top: 1px;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.padding {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
> svg {
|
> svg {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
margin-inline-end: 4px;
|
||||||
transition: .2s ease transform;
|
transition: .2s ease transform;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&:not([open]) {
|
&:not([open]) {
|
||||||
summary {
|
summary {
|
||||||
|
|
|
@ -118,7 +118,7 @@ export default function Friends() {
|
||||||
id={`friends_${section_id}`}
|
id={`friends_${section_id}`}
|
||||||
defaultValue={true}
|
defaultValue={true}
|
||||||
sticky large
|
sticky large
|
||||||
summary={<Overline type="subtle" className="overline"><Text id={i18n} /> — { list.length }</Overline>}>
|
summary={<div class="title"><Text id={i18n} /> — { list.length }</div>}>
|
||||||
{ list.map(x => <Friend key={x._id} user={x} />) }
|
{ list.map(x => <Friend key={x._id} user={x} />) }
|
||||||
</CollapsibleSection>
|
</CollapsibleSection>
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue