diff --git a/src/components/common/messaging/attachments/TextFile.tsx b/src/components/common/messaging/attachments/TextFile.tsx index 810a2f0b..c01976f5 100644 --- a/src/components/common/messaging/attachments/TextFile.tsx +++ b/src/components/common/messaging/attachments/TextFile.tsx @@ -49,7 +49,7 @@ export default function TextFile({ attachment }: Props) { content ?
{ content }
: - + } diff --git a/src/components/ui/Preloader.tsx b/src/components/ui/Preloader.tsx index 4f92146c..7e3ec3fc 100644 --- a/src/components/ui/Preloader.tsx +++ b/src/components/ui/Preloader.tsx @@ -1,3 +1,103 @@ -export default function Preloader() { - return LOADING; +import styled, { keyframes } from "styled-components"; + +const skSpinner = keyframes` + 0%, 80%, 100% { + -webkit-transform: scale(0); + transform: scale(0); + } + 40% { + -webkit-transform: scale(1.0); + transform: scale(1.0); + } +`; + +const prRing = keyframes` + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +`; + +const PreloaderBase = styled.div` + width: 100%; + height: 100%; + + display: grid; + place-items: center; + + .spinner { + width: 58px; + display: flex; + text-align: center; + margin: 100px auto 0; + justify-content: space-between; + } + + .spinner > div { + width: 14px; + height: 14px; + background-color: var(--tertiary-foreground); + + border-radius: 100%; + display: inline-block; + animation: ${skSpinner} 1.4s infinite ease-in-out both; + } + + .spinner div:nth-child(1) { + animation-delay: -0.32s; + } + + .spinner div:nth-child(2) { + animation-delay: -0.16s; + } + + .ring { + display: inline-block; + position: relative; + width: 48px; + height: 52px; + } + + .ring div { + width: 32px; + margin: 8px; + height: 32px; + display: block; + position: absolute; + border-radius: 50%; + box-sizing: border-box; + border: 2px solid #fff; + animation: ${prRing} 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite; + border-color: #fff transparent transparent transparent; + } + + .ring div:nth-child(1) { + animation-delay: -0.45s; + } + + .ring div:nth-child(2) { + animation-delay: -0.3s; + } + + .ring div:nth-child(3) { + animation-delay: -0.15s; + } +`; + +interface Props { + type: 'spinner' | 'ring' +} + +export default function Preloader({ type }: Props) { + return ( + +
+
+
+
+
+ + ); } diff --git a/src/context/intermediate/modals/Onboarding.tsx b/src/context/intermediate/modals/Onboarding.tsx index 032aa5f3..8f3894d8 100644 --- a/src/context/intermediate/modals/Onboarding.tsx +++ b/src/context/intermediate/modals/Onboarding.tsx @@ -39,7 +39,7 @@ export function OnboardingModal({ onClose, callback }: Props) {
{loading ? ( - + ) : ( <>

diff --git a/src/context/intermediate/popovers/UserProfile.tsx b/src/context/intermediate/popovers/UserProfile.tsx index 2b37ee7c..2bcddb36 100644 --- a/src/context/intermediate/popovers/UserProfile.tsx +++ b/src/context/intermediate/popovers/UserProfile.tsx @@ -309,7 +309,7 @@ export function UserProfile({ user_id, onClose, dummy, dummyProfile }: Props) { )}

) : ( - + ))} {tab === "groups" && (
diff --git a/src/context/revoltjs/FileUploads.tsx b/src/context/revoltjs/FileUploads.tsx index df10fb4c..4be51c16 100644 --- a/src/context/revoltjs/FileUploads.tsx +++ b/src/context/revoltjs/FileUploads.tsx @@ -187,7 +187,7 @@ export function FileUploader(props: Props) { onClick={onClick}> { uploading ?
- +
:
diff --git a/src/context/revoltjs/RequiresOnline.tsx b/src/context/revoltjs/RequiresOnline.tsx index 73b7f721..20779e5f 100644 --- a/src/context/revoltjs/RequiresOnline.tsx +++ b/src/context/revoltjs/RequiresOnline.tsx @@ -29,7 +29,7 @@ const Base = styled.div` export default function RequiresOnline(props: Props) { const status = useContext(StatusContext); - if (status === ClientStatus.CONNECTING) return ; + if (status === ClientStatus.CONNECTING) return ; if (status !== ClientStatus.ONLINE && status !== ClientStatus.READY) return ( diff --git a/src/context/revoltjs/RevoltClient.tsx b/src/context/revoltjs/RevoltClient.tsx index 045b7f94..8718ef41 100644 --- a/src/context/revoltjs/RevoltClient.tsx +++ b/src/context/revoltjs/RevoltClient.tsx @@ -202,7 +202,7 @@ function Context({ auth, sync, children, dispatcher }: Props) { }, []); if (status === ClientStatus.LOADING) { - return ; + return ; } return ( diff --git a/src/pages/RevoltApp.tsx b/src/pages/RevoltApp.tsx index 53400ce8..ad93f0c2 100644 --- a/src/pages/RevoltApp.tsx +++ b/src/pages/RevoltApp.tsx @@ -34,13 +34,15 @@ const Routes = styled.div` export default function App() { const path = useLocation().pathname; const fixedBottomNav = (path === '/' || path === '/settings' || path.startsWith("/friends")); + const inSettings = path === '/settings'; + const inChannel = path.includes('/channel'); return ( }} - rightPanel={{ width: 240, component: }} + leftPanel={inSettings ? undefined : { width: 292, component: }} + rightPanel={(!inSettings && inChannel) ? { width: 240, component: } : undefined} bottomNav={{ component: , showIf: fixedBottomNav ? ShowIf.Always : ShowIf.Left, diff --git a/src/pages/app.tsx b/src/pages/app.tsx index c6af90ae..d77f32e3 100644 --- a/src/pages/app.tsx +++ b/src/pages/app.tsx @@ -12,7 +12,7 @@ export function App() { {/* // @ts-expect-error */} - }> + }> diff --git a/src/pages/channels/messaging/MessageArea.tsx b/src/pages/channels/messaging/MessageArea.tsx index 6e609662..a178fab8 100644 --- a/src/pages/channels/messaging/MessageArea.tsx +++ b/src/pages/channels/messaging/MessageArea.tsx @@ -215,10 +215,10 @@ export function MessageArea({ id }: Props) {
- {state.type === "LOADING" && } + {state.type === "LOADING" && } {state.type === "WAITING_FOR_NETWORK" && ( - + )} {state.type === "RENDER" && ( diff --git a/src/pages/channels/messaging/MessageRenderer.tsx b/src/pages/channels/messaging/MessageRenderer.tsx index ab53edf7..2c665827 100644 --- a/src/pages/channels/messaging/MessageRenderer.tsx +++ b/src/pages/channels/messaging/MessageRenderer.tsx @@ -60,7 +60,7 @@ function MessageRenderer({ id, state, queue }: Props) { } else { render.push( - + ); } @@ -148,7 +148,7 @@ function MessageRenderer({ id, state, queue }: Props) { } else { render.push( - + ); } diff --git a/src/pages/invite/Invite.tsx b/src/pages/invite/Invite.tsx index cb01eaf1..831895d6 100644 --- a/src/pages/invite/Invite.tsx +++ b/src/pages/invite/Invite.tsx @@ -34,7 +34,7 @@ export default function Invite() {
{ error ? - : } + : }
) @@ -52,7 +52,7 @@ export default function Invite() {
}
- { processing ? : + { processing ? : <>

{ invite.server_name }

#{invite.channel_name}

diff --git a/src/pages/login/forms/CaptchaBlock.tsx b/src/pages/login/forms/CaptchaBlock.tsx index e55b0980..f435f017 100644 --- a/src/pages/login/forms/CaptchaBlock.tsx +++ b/src/pages/login/forms/CaptchaBlock.tsx @@ -20,7 +20,7 @@ export function CaptchaBlock(props: CaptchaProps) { }, []); if (!client.configuration?.features.captcha.enabled) - return ; + return ; return (
diff --git a/src/pages/login/forms/Form.tsx b/src/pages/login/forms/Form.tsx index c3709b58..5d8911b3 100644 --- a/src/pages/login/forms/Form.tsx +++ b/src/pages/login/forms/Form.tsx @@ -138,7 +138,7 @@ export function Form({ page, callback }: Props) { } if (captcha) return ; - if (loading) return ; + if (loading) return ; return (
diff --git a/src/pages/settings/panes/Sessions.tsx b/src/pages/settings/panes/Sessions.tsx index dff80268..e0501d7f 100644 --- a/src/pages/settings/panes/Sessions.tsx +++ b/src/pages/settings/panes/Sessions.tsx @@ -55,7 +55,7 @@ export function Sessions() { if (typeof sessions === "undefined") { return (
- +
); } diff --git a/src/pages/settings/server/Invites.tsx b/src/pages/settings/server/Invites.tsx index 42144a96..21e03370 100644 --- a/src/pages/settings/server/Invites.tsx +++ b/src/pages/settings/server/Invites.tsx @@ -27,7 +27,7 @@ export function Invites({ server }: Props) { return (
- { typeof invites === 'undefined' && } + { typeof invites === 'undefined' && } { invites?.map( invite => {