-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Feat/#313: 건물 정보 UI 구현
- Loading branch information
Showing
35 changed files
with
800 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM node:16 | ||
FROM node:18 | ||
WORKDIR /usr/src/app | ||
COPY package.json ./ | ||
RUN yarn | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export interface Room { | ||
roomNumber: string; | ||
roomName: string; | ||
} | ||
|
||
export type Floor = 'basement' | 'ground' | 'rooftop'; | ||
|
||
export type TotalFloorInfo = { | ||
[key in Floor]: { | ||
[key: string]: Room[]; | ||
}; | ||
}; | ||
|
||
export type FloorInfo = { | ||
[key: string]: Room[]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import http from '@apis/http'; | ||
import { SERVER_URL } from '@config/index'; | ||
|
||
const fetchBuildingInfo = async (buildingCode: string) => { | ||
try { | ||
const buildingInfo = await http.get( | ||
`${SERVER_URL}/api/buildingInfo?code=${buildingCode}`, | ||
); | ||
|
||
return buildingInfo; | ||
} catch (error) { | ||
return error; | ||
} | ||
}; | ||
|
||
export default fetchBuildingInfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { css } from '@emotion/react'; | ||
import styled from '@emotion/styled'; | ||
import { THEME } from '@styles/ThemeProvider/theme'; | ||
import React, { useState } from 'react'; | ||
|
||
import Icon from '../Icon'; | ||
|
||
interface ToggleInfoProps { | ||
infoTitle: () => JSX.Element; | ||
infoDesc: () => JSX.Element; | ||
} | ||
|
||
const ToggleInfo = ({ infoTitle, infoDesc }: ToggleInfoProps) => { | ||
const [showInfo, setShowInfo] = useState<boolean>(false); | ||
const toggleInfo = () => setShowInfo((prevState) => !prevState); | ||
|
||
return ( | ||
<> | ||
<ToggleContainer showInfo={showInfo} onClick={toggleInfo}> | ||
{infoTitle()} | ||
<IconContainer> | ||
<Icon kind="arrowDown" size="24" /> | ||
</IconContainer> | ||
</ToggleContainer> | ||
{showInfo && infoDesc()} | ||
</> | ||
); | ||
}; | ||
|
||
export default ToggleInfo; | ||
|
||
const ToggleContainer = styled.section<{ showInfo: boolean }>` | ||
position: relative; | ||
padding: 10px 0px 10px 0px; | ||
display: flex; | ||
align-items: center; | ||
${({ showInfo }) => css` | ||
& > span { | ||
color: ${showInfo && THEME.PRIMARY}; | ||
} | ||
& > div > svg { | ||
transform: ${showInfo ? 'rotate(-180deg)' : 'rotate(0deg)'}; | ||
transition: all ease 0.3s; | ||
} | ||
`} | ||
`; | ||
|
||
const IconContainer = styled.div` | ||
position: absolute; | ||
right: 0; | ||
display: flex; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.