Skip to content

Commit

Permalink
refactor: auth button ui 변경에 따른 반응형 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
pipisebastian committed Nov 30, 2024
1 parent 3a8a936 commit 1dec80b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 10 additions & 0 deletions client/src/features/auth/AuthButton.style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { css } from "@styled-system/css";

export const container = css({
display: "flex",
gap: "md",
flexGrow: 1,
justifyContent: "end",
alignItems: "center",
width: "auto",
});
10 changes: 6 additions & 4 deletions client/src/features/auth/AuthButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { TextButton } from "@components/button/textButton";
import { Modal } from "@components/modal/modal";
import { useModal } from "@components/modal/useModal";
import { AuthModal } from "./AuthModal";
import { css } from "@styled-system/css";
import { container } from "./AuthButton.style";

export const AuthButton = () => {
const isLogin = useCheckLogin();
Expand All @@ -23,13 +25,13 @@ export const AuthButton = () => {
const { mutate: logout } = useLogoutMutation(closeLogoutModal);

return (
<>
<div className={container}>
{isLogin ? (
<TextButton variant="secondary" onClick={openLogoutModal}>
<TextButton onClick={openLogoutModal} variant="secondary">
로그아웃
</TextButton>
) : (
<TextButton variant="secondary" onClick={openAuthModal}>
<TextButton onClick={openAuthModal} variant="secondary">
로그인
</TextButton>
)}
Expand All @@ -44,6 +46,6 @@ export const AuthButton = () => {
>
<p>로그아웃 하시겠습니까?</p>
</Modal>
</>
</div>
);
};

0 comments on commit 1dec80b

Please sign in to comment.