🚨(front) fix ui enhancement formats

Some formatting were forgotten, here is the fix.
This commit is contained in:
Nathan Vasse
2024-11-28 11:36:33 +01:00
parent 0b0efa5bab
commit 0b672ef8da
13 changed files with 359 additions and 356 deletions

View File

@@ -30,7 +30,7 @@ function App() {
<Route component={NotFoundScreen} /> <Route component={NotFoundScreen} />
</Switch> </Switch>
</Layout> </Layout>
<ReactQueryDevtools initialIsOpen={false} position="top-left" /> <ReactQueryDevtools initialIsOpen={false} />
</I18nProvider> </I18nProvider>
</Suspense> </Suspense>
</QueryClientProvider> </QueryClientProvider>

View File

@@ -17,7 +17,7 @@ import { MoreLink } from '@/features/home/components/MoreLink'
import { ReactNode, useState } from 'react' import { ReactNode, useState } from 'react'
import { css } from '@/styled-system/css' import { css } from '@/styled-system/css'
import { menuRecipe } from '@/primitives/menuRecipe.ts'; import { menuRecipe } from '@/primitives/menuRecipe.ts'
const Columns = ({ children }: { children?: ReactNode }) => { const Columns = ({ children }: { children?: ReactNode }) => {
return ( return (
@@ -173,7 +173,9 @@ export const Home = () => {
</Button> </Button>
<RACMenu> <RACMenu>
<MenuItem <MenuItem
className={menuRecipe({icon: true, variant: 'light'}).item} className={
menuRecipe({ icon: true, variant: 'light' }).item
}
onAction={async () => { onAction={async () => {
const slug = generateRoomId() const slug = generateRoomId()
createRoom({ slug, username }).then((data) => createRoom({ slug, username }).then((data) =>
@@ -188,7 +190,9 @@ export const Home = () => {
{t('createMenu.instantOption')} {t('createMenu.instantOption')}
</MenuItem> </MenuItem>
<MenuItem <MenuItem
className={menuRecipe({icon: true, variant: 'light'}).item} className={
menuRecipe({ icon: true, variant: 'light' }).item
}
onAction={() => { onAction={() => {
const slug = generateRoomId() const slug = generateRoomId()
createRoom({ slug, username }).then((data) => createRoom({ slug, username }).then((data) =>

View File

@@ -109,7 +109,7 @@ export const Conference = ({
video={userConfig.videoEnabled} video={userConfig.videoEnabled}
connectOptions={connectOptions} connectOptions={connectOptions}
className={css({ className={css({
backgroundColor: 'primaryDark.50 !important' backgroundColor: 'primaryDark.50 !important',
})} })}
> >
<VideoConference /> <VideoConference />

View File

@@ -9,7 +9,7 @@ import {
RiCloseLine, RiCloseLine,
RiFileCopyLine, RiFileCopyLine,
RiSpam2Fill, RiSpam2Fill,
} from '@remixicon/react'; } from '@remixicon/react'
import { useEffect, useState } from 'react' import { useEffect, useState } from 'react'
// fixme - extract in a proper primitive this dialog without overlay // fixme - extract in a proper primitive this dialog without overlay

View File

@@ -9,7 +9,7 @@ import { Dispatch, SetStateAction } from 'react'
import { DialogState } from './OptionsButton' import { DialogState } from './OptionsButton'
import { Separator } from '@/primitives/Separator' import { Separator } from '@/primitives/Separator'
import { useSidePanel } from '../../../hooks/useSidePanel' import { useSidePanel } from '../../../hooks/useSidePanel'
import { menuRecipe } from '@/primitives/menuRecipe.ts'; import { menuRecipe } from '@/primitives/menuRecipe.ts'
// @todo try refactoring it to use MenuList component // @todo try refactoring it to use MenuList component
export const OptionsMenuItems = ({ export const OptionsMenuItems = ({

View File

@@ -18,7 +18,7 @@ import { Track } from 'livekit-client'
import { Shortcut } from '@/features/shortcuts/types' import { Shortcut } from '@/features/shortcuts/types'
import { ToggleDevice } from '@/features/rooms/livekit/components/controls/ToggleDevice.tsx' import { ToggleDevice } from '@/features/rooms/livekit/components/controls/ToggleDevice.tsx'
import { css } from '@/styled-system/css'; import { css } from '@/styled-system/css'
export type ToggleSource = Exclude< export type ToggleSource = Exclude<
Track.Source, Track.Source,
@@ -86,10 +86,12 @@ export const SelectToggleDevice = <T extends ToggleSource>({
const selectLabel = t('choose', { keyPrefix: `join.${config.kind}` }) const selectLabel = t('choose', { keyPrefix: `join.${config.kind}` })
return ( return (
<div className={css({ <div
className={css({
display: 'flex', display: 'flex',
gap: '1px' gap: '1px',
})}> })}
>
<ToggleDevice {...trackProps} config={config} /> <ToggleDevice {...trackProps} config={config} />
<Menu> <Menu>
<Button <Button
@@ -97,7 +99,7 @@ export const SelectToggleDevice = <T extends ToggleSource>({
aria-label={selectLabel} aria-label={selectLabel}
groupPosition="right" groupPosition="right"
square square
variant={trackProps.enabled ? "primaryDark" : "error2"} variant={trackProps.enabled ? 'primaryDark' : 'error2'}
> >
<RiArrowDownSLine /> <RiArrowDownSLine />
</Button> </Button>

View File

@@ -112,12 +112,11 @@ export function ControlBar({
bottom: 0, bottom: 0,
left: 0, left: 0,
right: 0, right: 0,
base: { display: 'flex',
display: 'flex'
}
})} })}
> >
<div className={css({ <div
className={css({
display: 'flex', display: 'flex',
gap: '.5rem', gap: '.5rem',
alignItems: 'center', alignItems: 'center',
@@ -126,7 +125,8 @@ export function ControlBar({
left: '50%', left: '50%',
transform: 'translateX(-50%)', transform: 'translateX(-50%)',
}, },
})}> })}
>
<SelectToggleDevice <SelectToggleDevice
source={Track.Source.Microphone} source={Track.Source.Microphone}
onChange={microphoneOnChange} onChange={microphoneOnChange}
@@ -159,16 +159,18 @@ export function ControlBar({
<LeaveButton /> <LeaveButton />
<StartMediaButton /> <StartMediaButton />
</div> </div>
<div className={css({ <div
className={css({
display: 'flex', display: 'flex',
gap: '.5rem', gap: '.5rem',
alignItems: 'center', alignItems: 'center',
marginRight: '6.25rem', marginRight: '6.25rem',
lg: { lg: {
position: 'absolute', position: 'absolute',
right: 0 right: 0,
} },
})}> })}
>
<ChatToggle /> <ChatToggle />
<ParticipantsToggle /> <ParticipantsToggle />
</div> </div>

View File

@@ -28,10 +28,7 @@ export const FeedbackRoute = () => {
<VStack> <VStack>
<Heading>{t('feedback.heading')}</Heading> <Heading>{t('feedback.heading')}</Heading>
<HStack> <HStack>
<Button <Button variant="secondary" onPress={() => window.history.back()}>
variant="secondary"
onPress={() => window.history.back()}
>
{t('feedback.back')} {t('feedback.back')}
</Button> </Button>
<Button variant="primary" onPress={() => setLocation('/')}> <Button variant="primary" onPress={() => setLocation('/')}>

View File

@@ -83,7 +83,7 @@ export const Header = () => {
</span> </span>
</Button> </Button>
<MenuList <MenuList
variant={"light"} variant={'light'}
items={[{ value: 'logout', label: t('logout') }]} items={[{ value: 'logout', label: t('logout') }]}
onAction={(value) => { onAction={(value) => {
if (value === 'logout') { if (value === 'logout') {

View File

@@ -1,11 +1,7 @@
import { ReactNode } from 'react' import { ReactNode } from 'react'
import { Menu, MenuProps, MenuItem } from 'react-aria-components' import { Menu, MenuProps, MenuItem } from 'react-aria-components'
import { menuRecipe } from '@/primitives/menuRecipe.ts'; import { menuRecipe } from '@/primitives/menuRecipe.ts'
import type { RecipeVariantProps } from '@/styled-system/types'; import type { RecipeVariantProps } from '@/styled-system/types'
/** /**
* render a Button primitive that shows a popover showing a list of pressable items * render a Button primitive that shows a popover showing a list of pressable items
@@ -19,7 +15,8 @@ export const MenuList = <T extends string | number = string>({
onAction: (key: T) => void onAction: (key: T) => void
selectedItem?: T selectedItem?: T
items: Array<string | { value: T; label: ReactNode }> items: Array<string | { value: T; label: ReactNode }>
} & MenuProps<unknown> & RecipeVariantProps<typeof menuRecipe>) => { } & MenuProps<unknown> &
RecipeVariantProps<typeof menuRecipe>) => {
const [variantProps] = menuRecipe.splitVariantProps(menuProps) const [variantProps] = menuRecipe.splitVariantProps(menuProps)
const classes = menuRecipe({ extraPadding: true, ...variantProps }) const classes = menuRecipe({ extraPadding: true, ...variantProps })
return ( return (

View File

@@ -11,7 +11,7 @@ import {
} from 'react-aria-components' } from 'react-aria-components'
import { Box } from './Box' import { Box } from './Box'
import { StyledPopover } from './Popover' import { StyledPopover } from './Popover'
import { menuRecipe } from '@/primitives/menuRecipe.ts'; import { menuRecipe } from '@/primitives/menuRecipe.ts'
const StyledButton = styled(Button, { const StyledButton = styled(Button, {
base: { base: {
@@ -75,7 +75,9 @@ export const Select = <T extends string | number>({
<ListBox> <ListBox>
{items.map((item) => ( {items.map((item) => (
<ListBoxItem <ListBoxItem
className={menuRecipe({extraPadding: true, variant: 'light'}).item} className={
menuRecipe({ extraPadding: true, variant: 'light' }).item
}
id={item.value} id={item.value}
key={item.value} key={item.value}
> >

View File

@@ -1,4 +1,4 @@
import { type RecipeVariantProps, cva } from '@/styled-system/css'; import { type RecipeVariantProps, cva } from '@/styled-system/css'
export type ButtonRecipe = typeof buttonRecipe export type ButtonRecipe = typeof buttonRecipe
@@ -92,7 +92,7 @@ export const buttonRecipe = cva({
color: 'white', color: 'white',
'&[data-pressed]': { '&[data-pressed]': {
backgroundColor: 'primaryDark.900', backgroundColor: 'primaryDark.900',
color: 'primaryDark.100' color: 'primaryDark.100',
}, },
'&[data-hovered]': { '&[data-hovered]': {
backgroundColor: 'primaryDark.300', backgroundColor: 'primaryDark.300',
@@ -100,7 +100,7 @@ export const buttonRecipe = cva({
}, },
'&[data-selected]': { '&[data-selected]': {
backgroundColor: 'primaryDark.900 !important', backgroundColor: 'primaryDark.900 !important',
color: 'primaryDark.100 !important' color: 'primaryDark.100 !important',
}, },
}, },
primaryTextDark: { primaryTextDark: {
@@ -111,11 +111,11 @@ export const buttonRecipe = cva({
}, },
'&[data-pressed]': { '&[data-pressed]': {
backgroundColor: 'primaryDark.700', backgroundColor: 'primaryDark.700',
color: 'primaryDark.100' color: 'primaryDark.100',
}, },
'&[data-selected]': { '&[data-selected]': {
backgroundColor: 'primaryDark.700', backgroundColor: 'primaryDark.700',
color: 'primaryDark.100' color: 'primaryDark.100',
}, },
}, },
greyscale: { greyscale: {
@@ -209,7 +209,9 @@ export const buttonRecipe = cva({
}, },
}, },
// some toggle buttons make more sense without a "pushed button" style when selected because their content changes to mark the state // some toggle buttons make more sense without a "pushed button" style when selected because their content changes to mark the state
shySelected: {}, shySelected: {
true: {},
},
// if the button is next to other ones to make a "button group", tell where the button is to handle radius // if the button is next to other ones to make a "button group", tell where the button is to handle radius
groupPosition: { groupPosition: {
left: { left: {
@@ -233,14 +235,13 @@ export const buttonRecipe = cva({
css: { css: {
'&[data-selected]': { '&[data-selected]': {
backgroundColor: 'primaryDark.100', backgroundColor: 'primaryDark.100',
color: 'white' color: 'white',
},
},
}, },
}
}
], ],
defaultVariants: { defaultVariants: {
size: 'default', size: 'default',
variant: 'primary', variant: 'primary',
}, },
}); })

View File

@@ -1,4 +1,4 @@
import { sva } from '@/styled-system/css'; import { sva } from '@/styled-system/css'
export const menuRecipe = sva({ export const menuRecipe = sva({
slots: ['root', 'item'], slots: ['root', 'item'],
@@ -32,7 +32,7 @@ export const menuRecipe = sva({
backgroundColor: 'primaryDark.100', backgroundColor: 'primaryDark.100',
outline: 'none!', outline: 'none!',
}, },
} },
}, },
variants: { variants: {
variant: { variant: {
@@ -44,17 +44,15 @@ export const menuRecipe = sva({
'&[data-hovered]': { '&[data-hovered]': {
backgroundColor: 'primary.800', backgroundColor: 'primary.800',
}, },
}
}, },
dark: { },
dark: {},
}
}, },
extraPadding: { extraPadding: {
true: { true: {
item: { item: {
paddingLeft: 1.5, paddingLeft: 1.5,
} },
}, },
}, },
icon: { icon: {
@@ -64,11 +62,11 @@ export const menuRecipe = sva({
alignItems: 'center', alignItems: 'center',
gap: '1rem', gap: '1rem',
paddingY: '0.4rem', paddingY: '0.4rem',
} },
}, },
}, },
}, },
defaultVariants: { defaultVariants: {
variant: 'dark' variant: 'dark',
} },
}) })