Fix profiles not loading.

This commit is contained in:
Paul 2021-08-05 23:25:49 +01:00
parent 2847318294
commit d841b9e3cd
3 changed files with 82 additions and 36 deletions

View file

@ -57,13 +57,13 @@
gap: 8px; gap: 8px;
display: flex; display: flex;
padding: 0 1.5em; padding: 0 1.5em;
font-size: .875rem; font-size: 0.875rem;
> div { > div {
padding: 8px; padding: 8px;
cursor: pointer; cursor: pointer;
border-bottom: 2px solid transparent; border-bottom: 2px solid transparent;
transition: border-bottom .3s; transition: border-bottom 0.3s;
&[data-active="true"] { &[data-active="true"] {
border-bottom: 2px solid var(--foreground); border-bottom: 2px solid var(--foreground);
@ -81,7 +81,10 @@
height: 100%; height: 100%;
display: flex; display: flex;
padding: 1em 1.5em; padding: 1em 1.5em;
max-width: 560px; max-width: 560px;
max-height: 240px;
overflow-y: auto; overflow-y: auto;
flex-direction: column; flex-direction: column;
background: var(--primary-background); background: var(--primary-background);
@ -141,7 +144,7 @@
display: flex; display: flex;
cursor: pointer; cursor: pointer;
align-items: center; align-items: center;
transition: background-color .1s; transition: background-color 0.1s;
color: var(--secondary-foreground); color: var(--secondary-foreground);
border-radius: var(--border-radius); border-radius: var(--border-radius);
background-color: var(--secondary-background); background-color: var(--secondary-background);

View file

@ -75,13 +75,14 @@ export const UserProfile = observer(
if (!user_id) return; if (!user_id) return;
if (typeof profile !== "undefined") setProfile(undefined); if (typeof profile !== "undefined") setProfile(undefined);
if (typeof mutual !== "undefined") setMutual(undefined); if (typeof mutual !== "undefined") setMutual(undefined);
}, [user_id, mutual, profile]); // eslint-disable-next-line
}, [user_id]);
if (dummy) { useEffect(() => {
useLayoutEffect(() => { if (dummy) {
setProfile(dummyProfile); setProfile(dummyProfile);
}, [dummyProfile]); }
} }, [dummy, dummyProfile]);
useEffect(() => { useEffect(() => {
if (dummy) return; if (dummy) return;

View file

@ -1,18 +1,36 @@
/* Settings animations */ /* Settings animations */
@keyframes open { @keyframes open {
0% { transform: scale(1.2); opacity: 0; } 0% {
100% { transform: scale(1); opacity: 1; } transform: scale(1.2);
opacity: 0;
}
100% {
transform: scale(1);
opacity: 1;
}
} }
@keyframes close { @keyframes close {
0% { transform: scale(1); opacity: 1; } 0% {
100% { transform: scale(1.2); opacity: 0; } transform: scale(1);
opacity: 1;
}
100% {
transform: scale(1.2);
opacity: 0;
}
} }
@keyframes opacity { @keyframes opacity {
0% { opacity: 0; } 0% {
20% { opacity: 0.5; } opacity: 0;
50% { opacity: 1; } }
20% {
opacity: 0.5;
}
50% {
opacity: 1;
}
} }
/* Settings CSS */ /* Settings CSS */
@ -20,7 +38,10 @@
flex-direction: column; flex-direction: column;
background: var(--primary-header); background: var(--primary-header);
.sidebar, .content { background: var(--primary-background); } .sidebar,
.content {
background: var(--primary-background);
}
.scrollbox { .scrollbox {
&::-webkit-scrollbar-thumb { &::-webkit-scrollbar-thumb {
@ -37,15 +58,21 @@
min-width: 218px; min-width: 218px;
} }
.scrollbox { width: 100%; } .scrollbox {
.version { place-items: center; } width: 100%;
}
.version {
place-items: center;
}
} }
/* Content */ /* Content */
.content { .content {
padding: 0; padding: 0;
.scrollbox { overflow: auto; } .scrollbox {
overflow: auto;
}
.contentcontainer { .contentcontainer {
max-width: unset !important; max-width: unset !important;
@ -63,7 +90,9 @@
position: fixed; position: fixed;
animation: open 0.18s ease-out, opacity 0.18s; animation: open 0.18s ease-out, opacity 0.18s;
&.closing { animation: close 0.18s ease-in; } &.closing {
animation: close 0.18s ease-in;
}
} }
.settings { .settings {
@ -85,8 +114,9 @@
.scrollbox:focus { .scrollbox:focus {
visibility: visible; visibility: visible;
} }
::-webkit-scrollbar-thumb { // All children receive custom scrollbar.
> * > ::-webkit-scrollbar-thumb {
width: 4px; width: 4px;
background-clip: content-box; background-clip: content-box;
border-top: 80px solid transparent; border-top: 80px solid transparent;
@ -106,14 +136,20 @@
flex-direction: column; flex-direction: column;
} }
.divider { height: 30px; } .divider {
height: 30px;
}
.donate { color: goldenrod !important; } .donate {
.logOut {color: var(--error) !important; } color: goldenrod !important;
}
.logOut {
color: var(--error) !important;
}
.version { .version {
margin: 1rem 12px 0; margin: 1rem 12px 0;
font-size: .625rem; font-size: 0.625rem;
color: var(--secondary-foreground); color: var(--secondary-foreground);
font-family: var(--monospace-font), monospace; font-family: var(--monospace-font), monospace;
user-select: text; user-select: text;
@ -163,7 +199,7 @@
} }
h3 { h3 {
font-size: .8125rem; font-size: 0.8125rem;
text-transform: uppercase; text-transform: uppercase;
color: var(--secondary-foreground); color: var(--secondary-foreground);
@ -174,14 +210,14 @@
h4 { h4 {
margin: 4px 2px; margin: 4px 2px;
font-size: .8125rem; font-size: 0.8125rem;
color: var(--tertiary-foreground); color: var(--tertiary-foreground);
text-transform: uppercase; text-transform: uppercase;
} }
h5 { h5 {
margin-top: 0; margin-top: 0;
font-size: .75rem; font-size: 0.75rem;
font-weight: 400; font-weight: 400;
} }
@ -189,7 +225,7 @@
border-top: 1px solid; border-top: 1px solid;
margin: 0; margin: 0;
padding-top: 5px; padding-top: 5px;
font-size: .875rem; font-size: 0.875rem;
color: var(--secondary-foreground); color: var(--secondary-foreground);
} }
} }
@ -207,8 +243,8 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
width: 40px; width: 40px;
opacity: .5; opacity: 0.5;
font-size: .75rem; font-size: 0.75rem;
} }
.closeButton { .closeButton {
@ -221,9 +257,15 @@
border: 3px solid var(--tertiary-background); border: 3px solid var(--tertiary-background);
cursor: pointer; cursor: pointer;
svg { color: var(--secondary-foreground); } svg {
&:hover { background: var(--secondary-header); } color: var(--secondary-foreground);
&:active { transform: translateY(2px); } }
&:hover {
background: var(--secondary-header);
}
&:active {
transform: translateY(2px);
}
} }
} }
} }
@ -233,4 +275,4 @@
visibility: visible !important; visibility: visible !important;
overflow-y: auto; overflow-y: auto;
} }
} }