Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/domains/profile/layouts/MyAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function MyAccount({}: MyAccountProps) {
if (!data?.data) return <div>Not Found</div>;

return (
<>
<section>
<Spacing heightGap={15} />
<SubTitle text="보유 포인트" />
<DisplayPoint point={data.data.me.points} />
Expand All @@ -30,6 +30,6 @@ export default function MyAccount({}: MyAccountProps) {
<TransferAccessButton />
</div>
<Spacing heightGap={15} />
</>
</section>
);
}
21 changes: 20 additions & 1 deletion src/domains/shared/component/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
outline?: boolean;
color?: Color;
fullWidth?: boolean;
variant?: "clear" | "solid";
};

const defaultButtonStyle = css`
Expand All @@ -29,6 +30,7 @@ export default function Button({
color = "#4B7FF0",
children,
fullWidth,
variant = "solid",
...args
}: ButtonProps) {
const buttonStyle = useMemo(
Expand Down Expand Up @@ -69,8 +71,25 @@ export default function Button({
`}
`;
}, [size, fullWidth]);

const buttonVariantStyle = useMemo(() => {
if (variant === "clear") {
return css`
background: none;
border: none;
`;
}
}, [variant]);
return (
<button css={[defaultButtonStyle, buttonStyle, buttonSizeStyle]} {...args}>
<button
css={[
defaultButtonStyle,
buttonStyle,
buttonSizeStyle,
buttonVariantStyle,
]}
{...args}
>
{children}
</button>
);
Expand Down
18 changes: 0 additions & 18 deletions src/domains/shared/component/GhostButton.tsx

This file was deleted.

20 changes: 10 additions & 10 deletions src/domains/shared/component/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import GameIcon from "public/icons/CodeSandboxOutlined.svg";
import NotiIcon from "public/icons/BellOutlined.svg";
import UnionIcon from "public/icons/CrownOutlined.svg";
import ProfileIcon from "public/icons/UserOutlined.svg";
import GhostButton from "./GhostButton";
import useRouting from "../hooks/useRouting";
import IconWithText from "./IconWithText";
import IconWithText from "./TextedIcon";
import { useRouter } from "next/router";
import Button from "./Button";

export default function Navigation() {
const moveTo = useRouting("push");
Expand All @@ -33,7 +33,7 @@ export default function Navigation() {
`,
]}
>
<GhostButton onClick={() => moveTo("/game")}>
<Button variant="clear" onClick={() => moveTo("/game")}>
<IconWithText
color={router.pathname === "/game" ? "#4B7FF0" : "#000000"}
icon={
Expand All @@ -43,8 +43,8 @@ export default function Navigation() {
}
bottomText="Game"
/>
</GhostButton>
<GhostButton onClick={() => moveTo("/notification")}>
</Button>
<Button variant="clear" onClick={() => moveTo("/notification")}>
<IconWithText
color={
router.pathname === "/notification" ? "#4B7FF0" : "#000000"
Expand All @@ -58,8 +58,8 @@ export default function Navigation() {
}
bottomText="Noti"
/>
</GhostButton>
<GhostButton onClick={() => moveTo("/union")}>
</Button>
<Button variant="clear" onClick={() => moveTo("/union")}>
<IconWithText
color={router.pathname === "/union" ? "#4B7FF0" : "#000000"}
icon={
Expand All @@ -69,8 +69,8 @@ export default function Navigation() {
}
bottomText="Union"
/>
</GhostButton>
<GhostButton onClick={() => moveTo("/")}>
</Button>
<Button variant="clear" onClick={() => moveTo("/")}>
<IconWithText
color={router.pathname === "/" ? "#4B7FF0" : "#000000"}
icon={
Expand All @@ -80,7 +80,7 @@ export default function Navigation() {
}
bottomText="Profile"
/>
</GhostButton>
</Button>
</nav>
</section>
</footer>
Expand Down
6 changes: 3 additions & 3 deletions src/domains/shared/component/StatusRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Image from "next/image";
import { commaizeNumber } from "@toss/utils";
import { ReactElement } from "react";

interface ProfileRowProps {
interface StatusRowProps {
image: string | null;
name: string;
point: number;
Expand Down Expand Up @@ -34,12 +34,12 @@ const iconBoxStyle = css`
margin-left: 10px;
`;

export default function ProfileRow({
export default function StatusRow({
image,
name,
point,
icon,
}: ProfileRowProps) {
}: StatusRowProps) {
return (
<li>
<div css={profileRowStyle}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
import { Color } from "@/styles/sharedStyles";
import { css } from "@emotion/react";
import { ReactElement } from "react";
import { ReactElement, useMemo } from "react";

type IconWithTextProps = {
type TextedIconProps = {
bottomText: string;
icon: ReactElement;
size?: number;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

4, 8, 12, 16

color?: Color;
};

function IconWithText({
function TextedIcon({
bottomText,
icon,
size = 16,
color = "#000000",
}: IconWithTextProps) {
const IconText = css`
font-size: 16px;
color: ${color};
`;
}: TextedIconProps) {
const IconText = useMemo(
() => css`
font-size: ${size}px;
color: ${color};
`,
[size, color]
);

return (
<div css={IconContainer} aria-labelledby={bottomText}>
Expand All @@ -33,8 +38,4 @@ const IconContainer = css`
flex-direction: column;
`;

const IconText = css`
font-size: 16px;
`;

export default IconWithText;
export default TextedIcon;