Skip to content

Commit

Permalink
[#141] Fix: 필요하지 않은 재료이면 cursor 허용안함 (#142)
Browse files Browse the repository at this point in the history
Co-authored-by: minsour <[email protected]>
  • Loading branch information
Kim-Jaemin420 and minsour authored Feb 9, 2024
1 parent 3e2cd37 commit 23ac6c0
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 90 deletions.
2 changes: 1 addition & 1 deletion src/components/TteokgukCookingPage/Ingredient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const styles = {
height: "5.6rem",
borderRadius: "50%",
backgroundColor,
cursor: `${backgroundColor === "white" ? "default" : "pointer"}`,
cursor: `${backgroundColor === "white" ? "not-allowed" : "pointer"}`,
}),
ingredientNumber: css({
position: "absolute",
Expand Down
29 changes: 18 additions & 11 deletions src/components/common/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,18 @@ const Header = ({

return (
<header className={classNames(styles.header, className)}>
{showSearchIcon && (
<Link to="/user/search" className={styles.icon}>
<SearchIcon aria-label="검색" />
</Link>
)}
{showBackButton && (
<div onClick={handleClickBefore} className={styles.icon} aria-label="뒤로 가기">
<BeforeIcon />
</div>
)}
<div className={styles.leftSection}>
{showSearchIcon && (
<Link to="/user/search" className={styles.icon}>
<SearchIcon aria-label="검색" />
</Link>
)}
{showBackButton && (
<button onClick={handleClickBefore} className={styles.icon} aria-label="뒤로 가기">
<BeforeIcon />
</button>
)}
</div>
<div className={styles.title}>
<h1>{children}</h1>
</div>
Expand Down Expand Up @@ -102,13 +104,18 @@ const styles = {
height: "4.8rem",
padding: "0 1.6rem",
}),
icon: css({
leftSection: css({
display: "flex",
flex: 1,
alignItems: "center",
}),
icon: css({
cursor: "pointer",
}),
title: css({
fontSize: "1.6rem",
fontWeight: 700,
userSelect: "none",
}),
actionIcon: css({
display: "flex",
Expand Down
4 changes: 1 addition & 3 deletions src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ const HomePage = () => {
return (
<div className={styles.container}>
<h1 className={styles.logo}>
<Link to="/">
<img src={homeLogo} alt="로고" />
</Link>
<img src={homeLogo} alt="로고" />
</h1>
<div className={styles.dragon}>
<img src={tryDragon} alt="떡국 권하는 용용이" />
Expand Down
67 changes: 30 additions & 37 deletions src/pages/MainPage.fallback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,43 @@ import Header from "@/components/common/Header";
import Loading from "@/components/common/Loading";
import { Link } from "@/routes/Link";
import HeaderLogo from "@/assets/svg/header-logo.svg";
import classNames from "classnames";

const MainPageFallback = () => {
return (
<div className={styles.container}>
<main className={styles.main}>
<Header showSearchIcon actionIcon="profile">
<Link to="/tteokguks">
<HeaderLogo aria-label="용용이" />
</Link>
</Header>
<div className={styles.tabContainer}>
<Tabs selectedIndex={0} onSelect={() => {}}>
<TabList className={styles.tabList}>
<Tab className={styles.selectedTab}>새로운 떡국</Tab>
<Tab>완성된 떡국</Tab>
</TabList>
<TabPanel className={styles.tabPanel}>
<Loading />
</TabPanel>
<TabPanel className={styles.tabPanel}>
<Loading />
</TabPanel>
</Tabs>
</div>
</main>
</div>
<>
<Header showSearchIcon actionIcon="profile">
<Link to="/tteokguks">
<HeaderLogo aria-label="용용이" />
</Link>
</Header>
<div className={styles.tabContainer}>
<Tabs selectedIndex={0} onSelect={() => {}}>
<TabList className={styles.tabList}>
<Tab className={classNames(styles.tab, styles.selectedTab)}>새로운 떡국</Tab>
<Tab className={styles.tab}>완성된 떡국</Tab>
</TabList>
<TabPanel className={styles.tabPanel}>
<Loading />
</TabPanel>
<TabPanel className={styles.tabPanel}>
<Loading />
</TabPanel>
</Tabs>
</div>
</>
);
};

export default MainPageFallback;

const styles = {
container: css({
maxWidth: "50rem",
width: "100%",
height: "100vh",
margin: "0 auto",
}),

main: css({
width: "100%",
minHeight: "100vh",
flexGrow: 1,
backgroundColor: "back",
}),

tabContainer: css({
position: "relative",
width: "100%",
height: "calc(100% - 4.8rem)",
overflow: "auto",
paddingBottom: "2rem",
}),

tabList: css({
Expand All @@ -70,6 +57,12 @@ const styles = {
cursor: "pointer",
}),

tab: css({
width: "50%",
textAlign: "center",
outline: "none",
}),

selectedTab: css({
position: "relative",
_after: {
Expand Down
5 changes: 2 additions & 3 deletions src/pages/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ const MainPage = () => {
return (
<>
<Header showSearchIcon actionIcon="profile">
<Link to="/tteokguks">
<HeaderLogo aria-label="용용이" />
</Link>
<HeaderLogo aria-label="용용이" />
</Header>
<div className={styles.container}>
<>
Expand Down Expand Up @@ -138,6 +136,7 @@ const styles = {
tab: css({
width: "50%",
textAlign: "center",
outline: "none",
}),
tabPanel: css({
display: "flex",
Expand Down
58 changes: 23 additions & 35 deletions src/pages/MyActivityPage.fallback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,35 @@ import { css } from "@styled-system/css";

import Header from "@/components/common/Header";
import Loading from "@/components/common/Loading";
import classNames from "classnames";

const MyActivityPageFallback = () => {
return (
<div className={styles.container}>
<main className={styles.main}>
<Header showBackButton>활동 내역</Header>
<div className={styles.tabContainer}>
<Tabs selectedIndex={0} onSelect={() => {}}>
<TabList className={styles.tabList}>
<Tab className={styles.selectedTab}>받은 떡국 재료</Tab>
<Tab>내가 응원한 떡국</Tab>
</TabList>
<TabPanel className={styles.tabPanel}>
<Loading />
</TabPanel>
<TabPanel className={styles.tabPanel}>
<Loading />
</TabPanel>
</Tabs>
</div>
</main>
</div>
<>
<Header showBackButton>활동 내역</Header>
<div className={styles.tabContainer}>
<Tabs selectedIndex={0} onSelect={() => {}}>
<TabList className={styles.tabList}>
<Tab className={classNames(styles.tab, styles.selectedTab)}>받은 떡국 재료</Tab>
<Tab className={styles.tab}>내가 응원한 떡국</Tab>
</TabList>
<TabPanel className={styles.tabPanel}>
<Loading />
</TabPanel>
<TabPanel className={styles.tabPanel}>
<Loading />
</TabPanel>
</Tabs>
</div>
</>
);
};

export default MyActivityPageFallback;

const styles = {
container: css({
maxWidth: "50rem",
width: "100%",
height: "100vh",
margin: "0 auto",
}),

main: css({
width: "100%",
minHeight: "100vh",
flexGrow: 1,
backgroundColor: "back",
}),

tabContainer: css({
position: "relative",
height: "calc(100% - 4.8rem)",
overflow: "auto",
}),

tabList: css({
Expand All @@ -64,6 +47,11 @@ const styles = {
cursor: "pointer",
}),

tab: css({
width: "50%",
textAlign: "center",
}),

selectedTab: css({
position: "relative",
_after: {
Expand Down

0 comments on commit 23ac6c0

Please sign in to comment.