Skip to content

Commit

Permalink
[Feat][Fe] #134 : classNames 사용
Browse files Browse the repository at this point in the history
  • Loading branch information
leedongyull committed Nov 12, 2024
1 parent 0d65616 commit ca96a3c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
11 changes: 10 additions & 1 deletion frontend/src/component/Layout/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import classNames from 'classnames';
import { buttonActiveType } from './enumTypes';

interface IFooterProps {
Expand All @@ -13,7 +14,15 @@ export const Footer = (props: IFooterProps) => {
return (
<footer className="absolute bottom-5 w-[95%] h-[6%]">
<button
className={`w-full h-full bg-white text-black p-2 rounded-lg ${buttonStyle}`}
className={classNames(
'w-full',
'h-full',
'bg-white',
'text-black',
'p-2',
'rounded-lg',
buttonStyle,
)}
type="button"
onClick={props.onClick}
>
Expand Down
14 changes: 13 additions & 1 deletion frontend/src/component/Layout/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { ReactElement } from 'react';
import classNames from 'classnames';
import { backgroundType } from './enumTypes';

interface IHeaderProps {
Expand All @@ -11,7 +12,18 @@ export const Header = (props: IHeaderProps) => {
const background = props.isTransparency ? backgroundType.TRANSPARENCY : backgroundType.WHITE;

return (
<header className={`w-full h-16 p-4 flex items-center ${background} text-black gap-[16px]`}>
<header
className={classNames(
'w-full',
'h-16',
'p-4',
'flex ',
'items-center ',
'text-black ',
'gap-[16px]',
background,
)}
>
{props.buttonElement}
<h1 className="text-base">{props.title}</h1>
</header>
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/component/Layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { ReactElement } from 'react';
import classNames from 'classnames';
import { Header } from './Header';
import { Footer } from './Footer';

Expand All @@ -13,7 +14,9 @@ interface ILayoutProps {
}

export const Layout = (props: ILayoutProps) => (
<div className="flex flex-col items-center w-full h-full bg-gray-400">
<div
className={classNames('flex', 'flex-col', 'items-center', 'w-full', 'h-full', 'bg-gray-400')}
>
{/* Header */}
<Header
title={props.headerTitle}
Expand Down

0 comments on commit ca96a3c

Please sign in to comment.