Skip to content

Commit

Permalink
Merge pull request #255 from woowacourse-teams/feature/#254
Browse files Browse the repository at this point in the history
홈, 해주세요 페이지 레이아웃 및 스타일링 수정
  • Loading branch information
cys4585 authored Aug 7, 2024
2 parents 57bab1c + 053013e commit fcf3931
Show file tree
Hide file tree
Showing 18 changed files with 61 additions and 49 deletions.
11 changes: 11 additions & 0 deletions frontend/src/components/HomeHeaderContent/HomHeaderContent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { useTheme } from '@emotion/react';
import { PropsWithChildren } from 'react';
import * as S from './HomeHeaderContent.style';

export default function HomeHeaderContent(props: PropsWithChildren) {
const { children } = props;

const theme = useTheme();

return <h1 css={S.logoStyle({ theme })}>{children}</h1>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { css, Theme } from '@emotion/react';

export const logoStyle = (props: { theme: Theme }) => css`
${props.theme.typography.h5}
`;
2 changes: 1 addition & 1 deletion frontend/src/components/MoimCard/MoimCard.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const cardBox = css`
width: 100%;
padding: 2rem 2.4rem;
background: white;
border-radius: 2.5rem;
box-shadow: rgb(0 0 0 / 24%) 0 3px 8px;
`;
Expand Down Expand Up @@ -69,7 +70,6 @@ export const detailInfo = (props: { theme: Theme }) => {
const { theme } = props;

return css`
${theme.typography.b3}
display: flex;
flex-direction: column;
gap: 0.2rem;
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/MoimCard/MoimCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ export default function MoimCard(props: MoimCardProps) {
</div>

<div css={S.detailInfo({ theme })}>
<span>{place}</span>
<span css={theme.typography.b3}>{place}</span>

<span>
<span css={theme.typography.b3}>
최대 {maxPeople}명 (현재 {currentPeople}명)
</span>
</div>
Expand Down
17 changes: 8 additions & 9 deletions frontend/src/components/MoimTabBar/MoimTabBar.style.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
import { css, Theme } from '@emotion/react';

export const tabStyle = (props: { theme: Theme }) => {
const { theme } = props;

export const tabStyle = () => {
return css`
display: flex;
gap: 12px;
${theme.typography.s1}
`;
};

export const tabItemStyle = (props: { theme: Theme; isTurnedOn: boolean }) => {
const { theme, isTurnedOn } = props;

return css({
color: isTurnedOn ? theme.semantic.primary : theme.semantic.disabled,
borderBottom: isTurnedOn ? `2px solid ${theme.semantic.primary}` : 'none',
});
return css`
${theme.typography.s1}
color: ${isTurnedOn ? theme.semantic.primary : theme.semantic.disabled};
border-bottom: ${isTurnedOn
? `2px solid ${theme.semantic.primary}`
: 'none'};
`;
};
2 changes: 1 addition & 1 deletion frontend/src/components/MoimTabBar/MoimTabBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function MoimTabBar(props: MoimTabBarProps) {
const theme = useTheme();

return (
<nav css={S.tabStyle({ theme })}>
<nav css={S.tabStyle}>
{tabs.map((tab, index) => (
<p
key={index}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/PleaseCard/PleaseCard.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const cardBox = css`
width: 100%;
padding: 2rem 2.4rem;
background: white;
border-radius: 2.5rem;
box-shadow: rgb(0 0 0 / 24%) 0 3px 8px;
`;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { DISPLAY_MAX_WIDTH } from '@_constants/styles';
import { css, Theme } from '@emotion/react';
import { css } from '@emotion/react';

export const headerStyle = css`
position: fixed;
top: 0;
display: flex;
flex-direction: column;
gap: 2.4rem;
width: 100%;
max-width: ${DISPLAY_MAX_WIDTH};
padding: 14px 22px;
padding: 14px 22px 0;
background-color: white;
`;

export const logoStyle = (props: { theme: Theme }) => css`
${props.theme.typography.h5}
`;
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import { PropsWithChildren } from 'react';
import * as S from './HomeHeader.style';
import { useTheme } from '@emotion/react';

export default function HomeHeader(props: PropsWithChildren) {
const { children } = props;
const theme = useTheme();

return (
<header css={S.headerStyle}>
<h1 css={S.logoStyle({ theme })}>{children}</h1>
</header>
);
return <header css={S.headerStyle}>{children}</header>;
}
8 changes: 5 additions & 3 deletions frontend/src/layouts/HomeLayout.tsx/HomeLayout.style.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { NAVIGATION_BAR_HEIGHT } from '@_constants/styles';
import { css } from '@emotion/react';
import { css, Theme } from '@emotion/react';

export const containerStyle = css`
margin-top: 8.6rem;
export const containerStyle = ({ theme }: { theme: Theme }) => css`
min-height: 100vh;
margin-top: 9.6rem;
margin-bottom: ${NAVIGATION_BAR_HEIGHT};
background-color: ${theme.colorPalette.grey[100]};
`;
5 changes: 4 additions & 1 deletion frontend/src/layouts/HomeLayout.tsx/HomeLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ import HomeFixedButtonWrapper from './HomeFixedButtonWrapper/HomeFixedButtonWrap
import HomeHeader from './HomeHeader/HomeHeader';
import HomeMain from './HomeMain/HomeMain';
import { PropsWithChildren } from 'react';
import { useTheme } from '@emotion/react';

function HomeLayout(props: PropsWithChildren) {
const { children } = props;

return <div css={S.containerStyle}>{children}</div>;
const theme = useTheme();

return <div css={S.containerStyle({ theme })}>{children}</div>;
}

HomeLayout.Header = HomeHeader;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { css, Theme } from '@emotion/react';
import { css } from '@emotion/react';

export const mainStyle = ({ theme }: { theme: Theme }) => css`
export const mainStyle = () => css`
padding: 16px 22px;
background-color: ${theme.colorPalette.grey[100]};
`;
5 changes: 1 addition & 4 deletions frontend/src/layouts/HomeLayout.tsx/HomeMain/HomeMain.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { useTheme } from '@emotion/react';
import * as S from './HomeMain.style';

import { PropsWithChildren } from 'react';

export default function HomeMain(props: PropsWithChildren) {
const { children } = props;

const theme = useTheme();

return <main css={S.mainStyle({ theme })}>{children}</main>;
return <main css={S.mainStyle}>{children}</main>;
}
6 changes: 4 additions & 2 deletions frontend/src/layouts/PleaseLayout/PleaseLayout.style.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { NAVIGATION_BAR_HEIGHT } from '@_constants/styles';
import { css } from '@emotion/react';
import { css, Theme } from '@emotion/react';

export const containerStyle = css`
export const containerStyle = ({ theme }: { theme: Theme }) => css`
min-height: 100vh;
margin-top: 5.6rem;
margin-bottom: ${NAVIGATION_BAR_HEIGHT};
background-color: ${theme.colorPalette.grey[100]};
`;
5 changes: 4 additions & 1 deletion frontend/src/layouts/PleaseLayout/PleaseLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ import PleaseHeader from './PleaseHeader/PleaseHeader';
import PleaseMain from './PleaseMain/PleaseMain';
import PleaseFixedButtonWrapper from './PleaseFixedButtonWrapper/PleaseFixedButtonWrapper';
import * as S from './PleaseLayout.style';
import { useTheme } from '@emotion/react';

function PleaseLayout(props: PropsWithChildren) {
const { children } = props;

return <div css={S.containerStyle}>{children}</div>;
const theme = useTheme();

return <div css={S.containerStyle({ theme })}>{children}</div>;
}

PleaseLayout.Header = PleaseHeader;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { css, Theme } from '@emotion/react';
import { css } from '@emotion/react';

export const mainStyle = ({ theme }: { theme: Theme }) => css`
export const mainStyle = () => css`
padding: 16px 22px;
background-color: ${theme.colorPalette.grey[100]};
`;
5 changes: 1 addition & 4 deletions frontend/src/layouts/PleaseLayout/PleaseMain/PleaseMain.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { useTheme } from '@emotion/react';
import * as S from './PleaseMain.style';

import { PropsWithChildren } from 'react';

export default function PleaseMain(props: PropsWithChildren) {
const { children } = props;

const theme = useTheme();

return <main css={S.mainStyle({ theme })}>{children}</main>;
return <main css={S.mainStyle}>{children}</main>;
}
4 changes: 2 additions & 2 deletions frontend/src/pages/MainPage/MainPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Fragment, useState } from 'react';
import MoimTabBar, { MainPageTab } from '@_components/MoimTabBar/MoimTabBar';

import Button from '@_components/Button/Button';
import HomeLayout from '@_layouts/HomeLayout.tsx/HomeLayout';
import HomeMainContent from '@_components/HomeMainContent/HomeMainContent';
Expand All @@ -9,6 +8,7 @@ import NavigationBarWrapper from '@_layouts/components/NavigationBarWrapper/Navi
import PlusIcon from '@_components/Icons/PlusIcon';
import ROUTES from '@_constants/routes';
import { useNavigate } from 'react-router-dom';
import HomeHeaderContent from '@_components/HomeHeaderContent/HomHeaderContent';

export default function MainPage() {
const navigate = useNavigate();
Expand All @@ -23,7 +23,7 @@ export default function MainPage() {
<Fragment>
<HomeLayout>
<HomeLayout.Header>
우아한테크코스
<HomeHeaderContent>우아한테크코스</HomeHeaderContent>
<MoimTabBar currentTab={currentTab} onTabClick={handleTabClick} />
</HomeLayout.Header>

Expand Down

0 comments on commit fcf3931

Please sign in to comment.