Skip to content

Commit

Permalink
pay technical debt
Browse files Browse the repository at this point in the history
  • Loading branch information
ASafaeirad committed Sep 14, 2023
1 parent c012da2 commit 6daa7a6
Show file tree
Hide file tree
Showing 53 changed files with 2,031 additions and 1,405 deletions.
8 changes: 3 additions & 5 deletions @types/mantine.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Tuple } from '@mantine/core';

import type { colors } from '../libs/design/theme/theme';
import type { Palette } from '../libs/design/theme/palette';

type DefaultMantineColors =
| 'blue'
Expand All @@ -19,11 +19,9 @@ type DefaultMantineColors =
| 'violet'
| 'yellow';

type IndexifyColor<T> = T extends DefaultMantineColors
? T | `${T}.${0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`
: T;
type IndexifyColor<T> = T | `${T}.${0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`;

type Colors = IndexifyColor<DefaultMantineColors | keyof typeof colors>;
type Colors = IndexifyColor<Palette | 'transparent'>;

declare module '@mantine/core' {
export interface MantineThemeColorsOverride {
Expand Down
31 changes: 15 additions & 16 deletions app/Auth/Login/Login.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
import { useAuth0 } from '@camp/auth';
import { messages } from '@camp/messages';
import { Button, Center, Group, Image } from '@mantine/core';
import { Button, Center, Flex, Image, Text, Title } from '@mantine/core';

export const Login = () => {
const { loginWithRedirect } = useAuth0();

return (
<Group grow spacing={0} sx={{ height: '100%' }}>
<Center>
<Button size="xl" onClick={() => loginWithRedirect()}>
{messages.login.loginFrom.submitButton.text}
</Button>
</Center>
<Center
sx={theme => ({
backgroundColor: theme.colors.bgCanvas[6],
height: '100%',
})}
>
<Image fit="scale-down" alt="login" src="/login-logo.png" />
</Center>
</Group>
<Center sx={{ height: '100%' }}>
<Flex direction="column" w={270} sx={{ translate: '0 -8%' }}>
<Image fit="scale-down" alt="logo" src="/login-logo.png" />
<Flex direction="column" align="center" gap={30}>
<Flex direction="column" align="center">
<Title order={1}>{messages.login.title}</Title>
<Text color="secondary">{messages.login.desc}</Text>
</Flex>
<Button fullWidth onClick={() => loginWithRedirect()}>
{messages.login.button}
</Button>
</Flex>
</Flex>
</Center>
);
};
2 changes: 1 addition & 1 deletion app/Dashboard/DashboardLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const useStyles = createStyles(theme => ({
paddingTop: 30,
paddingBottom: 0,
paddingInline: 40,
backgroundColor: theme.colors.bgCanvas[6],
backgroundColor: theme.colors.bg[6],
overflow: 'auto',
},
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const resolver = createResolver<FormSchema>({
const useStyles = createStyles(theme => ({
input: {
label: {
color: theme.colors.fgSubtle[6],
color: theme.colors.fg[4],
},
},
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const resolver = createResolver<FormSchema>({
const useStyles = createStyles(theme => ({
input: {
label: {
color: theme.colors.fgSubtle[6],
color: theme.colors.fg[4],
},
},
}));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { EmptyState } from '@camp/design';
import { UserIcon } from '@camp/icons';
import { messages } from '@camp/messages';
import { useMantineTheme } from '@mantine/core';

import { CreateMemberButton } from '../CreateMemberButton';

Expand All @@ -10,21 +9,10 @@ interface Props {
}

export const MemberEmptyState = ({ addNewMember }: Props) => {
const theme = useMantineTheme();
const t = messages.member.empty;

return (
<EmptyState
icon={
<UserIcon
width="33"
height="33"
color={theme.colors.primaryEmphasized[6]}
/>
}
title={t.title}
message={t.description}
>
<EmptyState Icon={UserIcon} title={t.title} message={t.description}>
<CreateMemberButton variant="filled" onClick={addNewMember} />
</EmptyState>
);
Expand Down
Loading

0 comments on commit 6daa7a6

Please sign in to comment.