Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

fix: button style fix #97

Merged
merged 5 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/components/auth/SignUpButton.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import { Button, Modal } from "@mantine/core";
import { Button, Modal, useMantineColorScheme } from "@mantine/core";
import { useDisclosure } from "@mantine/hooks";

import Register from "./register";

const SignUpButton = () => {
const [opened, { open, close }] = useDisclosure(false);

const { colorScheme } = useMantineColorScheme();
return (
<>
<Modal opened={opened} onClose={close} title="Joining us ?" centered>
<Register />
</Modal>

<Button compact onClick={open}>
<Button
compact
variant={colorScheme === "dark" ? "light" : "outline"}
onClick={open}
>
Sign up
</Button>
</>
Expand Down
4 changes: 3 additions & 1 deletion src/components/auth/register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ const Register = () => {
)}

<Group position="right" mt="md">
<Button type="submit">Submit</Button>
<Button variant="light" type="submit">
Submit
</Button>
</Group>
</form>
</Box>
Expand Down
20 changes: 14 additions & 6 deletions src/components/layout/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
Header,
createStyles,
rem,
useMantineColorScheme,
} from "@mantine/core";
import { IconHome } from "@tabler/icons-react";
import { signIn, useSession } from "next-auth/react";
Expand Down Expand Up @@ -38,6 +39,7 @@ const useStyles = createStyles((theme) => ({
const HeaderSearch = () => {
const { classes } = useStyles();
const { data: sessionData } = useSession();
const { colorScheme } = useMantineColorScheme();

return (
<Header height={56} className={classes.header} mb={120}>
Expand All @@ -51,12 +53,18 @@ const HeaderSearch = () => {
<Group>
<ToggleDarkMode />
{sessionData === null ? (
<Button.Group>
<Button compact onClick={() => void signIn()}>
Sign in
</Button>
<SignUpButton />
</Button.Group>
<>
<Button.Group>
<Button
compact
variant={colorScheme === "dark" ? "light" : "outline"}
onClick={() => void signIn()}
>
Sign in
</Button>
<SignUpButton />
</Button.Group>
</>
) : (
<AccountHeaderMenu />
)}
Expand Down
4 changes: 3 additions & 1 deletion src/pages/auth/new-user.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ const NewUserWelcome = () => {
/>

<Group position="right" mt="md">
<Button type="submit">Submit</Button>
<Button variant="light" type="submit">
Submit
</Button>
</Group>
</form>
</Box>
Expand Down
4 changes: 3 additions & 1 deletion src/pages/settings.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ const ProfileSettings = () => {
/>

<Group position="right" mt="md">
<Button type="submit">Submit</Button>
<Button type="submit" variant="outline" color="blue">
Submit
</Button>
</Group>
</form>
</Box>
Expand Down