-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[๐ : style] ์ฌ์ด๋ ๋ฉ๋ด + ํ ์คํ์ผ๋ง
- ๊ณตํต ์ปดํฌ๋ํธ ๊ด๋ฆฌ ๋ฐ ์คํ์ผ ๊ฐํธ - styles ๋ ํฌ ์ ๋ฆฌ
- Loading branch information
1 parent
0c74507
commit 453ec15
Showing
28 changed files
with
352 additions
and
142 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,12 +1,14 @@ | ||
import { Outlet } from 'react-router-dom'; | ||
import Wrapper from '../styles/layout.ts'; | ||
import Menu from './menu.tsx'; | ||
import { Wrapper } from '../styles/layout.ts'; | ||
import Search from './search.tsx'; | ||
|
||
export default function Layout() { | ||
return ( | ||
<Wrapper> | ||
<Menu /> | ||
<Outlet /> | ||
<Search /> | ||
</Wrapper> | ||
); | ||
} |
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,35 +1,77 @@ | ||
import { Link, useNavigate } from 'react-router-dom'; | ||
import { useEffect, useState } from 'react'; | ||
import { auth } from '../firebase.ts'; | ||
import * as S from '../styles/components/menu.ts'; | ||
import WindowTop from './window-top.tsx'; | ||
import * as W from '../styles/window.ts'; | ||
import * as S from '../styles/menu.ts'; | ||
import * as P from '../styles/popup.ts'; | ||
import ImageComputer from '../assets/images/logo-small.png'; | ||
import { ReactComponent as IconUser } from '../assets/images/i-user.svg'; | ||
import { ReactComponent as IconHome } from '../assets/images/i-home.svg'; | ||
import { ReactComponent as IconLogout } from '../assets/images/i-arrowleft.svg'; | ||
|
||
export default function Menu() { | ||
const navigate = useNavigate(); | ||
const [logoutPopup, setLogoutPopup] = useState(false); | ||
const toggleLogoutPopup = () => { | ||
setLogoutPopup(!logoutPopup); | ||
}; | ||
useEffect(() => { | ||
const handleEscKey = (e: KeyboardEvent) => { | ||
if (e.key === 'Escape') { | ||
setLogoutPopup(false); | ||
} | ||
}; | ||
document.addEventListener('keydown', handleEscKey); | ||
return () => { | ||
document.removeEventListener('keydown', handleEscKey); | ||
}; | ||
}, [logoutPopup]); | ||
const onLogout = async () => { | ||
// eslint-disable-next-line no-restricted-globals | ||
const ok = confirm('๋ก๊ทธ์์ ํ์๊ฒ ์ต๋๊น?'); | ||
if (ok) { | ||
await auth.signOut(); | ||
navigate('/auth'); | ||
} | ||
await auth.signOut(); | ||
navigate('/auth'); | ||
}; | ||
return ( | ||
<S.MenuList> | ||
<S.MenuItem> | ||
<Link to="/profile"> | ||
<IconUser /> | ||
</Link> | ||
</S.MenuItem> | ||
<S.MenuItem> | ||
<Link to="/"> | ||
<IconHome /> | ||
</Link> | ||
</S.MenuItem> | ||
<S.MenuItem onClick={onLogout} className="log-out"> | ||
<IconLogout /> | ||
</S.MenuItem> | ||
</S.MenuList> | ||
<W.Window as="nav"> | ||
<WindowTop /> | ||
<S.Logo> | ||
<S.LogoTitle> | ||
<span>Z</span>witter | ||
</S.LogoTitle> | ||
<S.LogoImage src={ImageComputer}></S.LogoImage> | ||
</S.Logo> | ||
<S.MenuList> | ||
<S.MenuItem> | ||
<Link to="/"> | ||
<IconHome /> ํ | ||
</Link> | ||
</S.MenuItem> | ||
<S.MenuItem> | ||
<Link to="/profile"> | ||
<IconUser /> ํ๋กํ | ||
</Link> | ||
</S.MenuItem> | ||
<S.MenuItem> | ||
<S.Button onClick={toggleLogoutPopup}> | ||
<IconLogout /> ๋ก๊ทธ์์ | ||
</S.Button> | ||
</S.MenuItem> | ||
{logoutPopup ? ( | ||
<P.PopupWrapper> | ||
<P.MiniPopup> | ||
<P.Text>๋ก๊ทธ์์ ํ์๊ฒ ์ต๋๊น?</P.Text> | ||
<P.ButtonWrapper> | ||
<P.Button onClick={onLogout} type="button"> | ||
์ | ||
</P.Button> | ||
<P.Button onClick={toggleLogoutPopup} type="button"> | ||
์๋์ | ||
</P.Button> | ||
</P.ButtonWrapper> | ||
</P.MiniPopup> | ||
</P.PopupWrapper> | ||
) : null} | ||
</S.MenuList> | ||
</W.Window> | ||
); | ||
} |
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,33 @@ | ||
import React, { useState } from 'react'; | ||
import WindowTop from './window-top.tsx'; | ||
import * as W from '../styles/window.ts'; | ||
import * as S from '../styles/search.ts'; | ||
import LoadingScreen from './loading-screen.tsx'; | ||
|
||
export default function Search() { | ||
const [error, setError] = useState(''); | ||
const [isLoading, setLoading] = useState(false); | ||
const [searchKeyword, setSearchKeyword] = useState(''); | ||
const onChange = (e: React.ChangeEvent<HTMLInputElement>) => { | ||
setSearchKeyword(e.target.value); | ||
}; | ||
return isLoading ? ( | ||
<LoadingScreen /> | ||
) : ( | ||
<W.Window> | ||
<WindowTop /> | ||
<S.Form> | ||
<S.FormInput | ||
onChange={onChange} | ||
name="searchKeyword" | ||
value={searchKeyword} | ||
placeholder="๊ฒ์ํ๊ธฐ" | ||
type="text" | ||
required | ||
></S.FormInput> | ||
<button type="submit">๊ฒ์</button> | ||
{error ? <p>{error}</p> : null} | ||
</S.Form> | ||
</W.Window> | ||
); | ||
} |
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 * as W from '../styles/window.ts'; | ||
import { ReactComponent as IconWindow1 } from '../assets/images/i-window1.svg'; | ||
import { ReactComponent as IconWindow2 } from '../assets/images/i-window2.svg'; | ||
import { ReactComponent as IconWindow3 } from '../assets/images/i-window3.svg'; | ||
|
||
export default function WindowTop() { | ||
return ( | ||
<W.TopBar> | ||
<W.IconWrapper> | ||
<IconWindow1 /> | ||
<IconWindow2 /> | ||
<IconWindow3 /> | ||
</W.IconWrapper> | ||
</W.TopBar> | ||
); | ||
} |
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,12 +1,14 @@ | ||
import WindowTop from '../components/window-top.tsx'; | ||
import PostTweetForm from '../components/post-tweet-form.tsx'; | ||
import Timeline from '../components/timeline.tsx'; | ||
import * as S from '../styles/layout.ts'; | ||
import * as W from '../styles/window.ts'; | ||
|
||
export default function Home() { | ||
return ( | ||
<S.HomeCenterWrapper> | ||
<W.Window> | ||
<WindowTop /> | ||
<PostTweetForm /> | ||
<Timeline /> | ||
</S.HomeCenterWrapper> | ||
</W.Window> | ||
); | ||
} |
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,3 @@ | ||
export default function SearchResult() { | ||
return null; | ||
} |
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.