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

Commit

Permalink
fix: button style fix (#97)
Browse files Browse the repository at this point in the history
* fix(style): style of button to display in different color scheme

* fix: button-style fix

* style: 🤖 prettier code by github action

---------

Co-authored-by: CUexter <CUexter@users.noreply.github.com>
  • Loading branch information
CUexter and CUexter authored Apr 13, 2023
1 parent 4c4057c commit 7e71aac
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 12 deletions.
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

1 comment on commit 7e71aac

@vercel
Copy link

@vercel vercel bot commented on 7e71aac Apr 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

tweet – ./

tweet-git-main-cuexter.vercel.app
tweet-cuexter.vercel.app
tweet-rose.vercel.app

Please sign in to comment.