Skip to content

Commit

Permalink
Merge pull request #75 from prgrms-fe-devcourse/feature/Deploy-1.1.0
Browse files Browse the repository at this point in the history
Deploy/version-1.1.0
  • Loading branch information
SoJuSo authored Jan 15, 2024
2 parents a59679d + 3010846 commit 75a22c2
Show file tree
Hide file tree
Showing 78 changed files with 1,693 additions and 652 deletions.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

![logo](https://github.com/prgrms-fe-devcourse/FEDC5_looky_heejin/assets/90549862/ceb789a7-3811-4231-b705-1016345d7fbb)

### [์„œ๋น„์Šค ์ฃผ์†Œ](https://www.looky.kr/)
### [๋ฉ”์ธ ์„œ๋น„์Šค ์ฃผ์†Œ](https://www.looky.kr/)

##### [๋„๋ฉ”์ธ ๋งŒ๋ฃŒ ์‹œ ์„œ๋น„์Šค ์ฃผ์†Œ](https://looky-working.vercel.app/)

---

Expand All @@ -18,8 +20,10 @@

## ํŒ€์› ์†Œ๊ฐœ

| [๊น€์„์ฃผ](https://github.com/SoJuSo) | [์‹ ์ˆ˜์˜](https://github.com/joyswim) | [์˜ค์›์ฃผ](https://github.com/OhWonJu) | [ํ™ฉ๋ฏผํ˜ธ](https://github.com/hellosonic-r) |
| ํŒ€์žฅ & COO | CKO | CTO | CAO |
| :-: | :-: | :-: | :-: |
| **โœจ์ตœ๊ณ  ์šด์˜ ์ฑ…์ž„์ž** | **โœจ์ตœ๊ณ  ์ง€์‹๊ฒฝ์˜ ์ฑ…์ž„์ž** | **โœจ์ตœ๊ณ  ๊ธฐ์ˆ  ์ฑ…์ž„์ž** | **โœจ์ตœ๊ณ  ๊ด€๋ฆฌ ์ฑ…์ž„์ž** |
| [๊น€์„์ฃผ](https://github.com/SoJuSo) | [์‹ ์ˆ˜์˜](https://github.com/joyswim) | [์˜ค์›์ฃผ](https://github.com/OhWonJu) | [ํ™ฉ๋ฏผํ˜ธ](https://github.com/hellosonic-r) |
| [email protected] | [email protected] | [email protected] | [email protected] |
| <img src="https://github.com/SoJuSo.png" /> | <img src="https://github.com/joyswim.png" /> | <img src="https://github.com/OhWonJu.png" /> | <img src="https://github.com/hellosonic-r.png" /> |

Expand All @@ -33,6 +37,16 @@ npm install
npm run dev
```

## ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ๋ชฉ๋ก

```
VITE_BASE_URL=
VITE_CRYPTO_KEY=
VITE_ADMIN_ID=
VITE_ADMIN_EMAIL=
VITE_ADMIN_PASSWORD=
```

## ํŒ€ ๋ฌธํ™” & ์ปจ๋ฒค์…˜

[looky Convention ์œ„ํ‚ค](https://github.com/prgrms-fe-devcourse/FEDC5_looky_heejin/wiki/Convention)
Expand Down
12 changes: 8 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,[email protected],100..700,0..1,-50..200"
/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property="og:title" content="looky" />
<meta property="og:url" content="https://looky.kr/" />
Expand All @@ -12,10 +20,6 @@
property="og:description"
content="ํŒจ์…˜์— ๊ด€์‹ฌ ์žˆ๋Š” lookys๋“ค์„ ์œ„ํ•œ SNS ์„œ๋น„์Šค. looky"
/>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,[email protected],100..700,0..1,-50..200"
/>
<title>looky</title>
</head>
<body>
Expand Down
21 changes: 21 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"react-merge-refs": "^2.1.1",
"react-redux": "^9.0.4",
"react-router-dom": "^6.21.1",
"react-toastify": "^9.1.3",
"react-use": "^17.4.2",
"redux": "^5.0.0",
"styled-components": "^6.1.3",
Expand Down
Binary file added public/looky_spinner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import useEventQuery from "./hooks/useEventQuery";
import { useLocalStorage } from "./hooks/useLocalStorage";
import { useMe } from "./hooks/useMe";
import { NotificationManager } from "./components/Notification";
import { aesDecrypt } from "./utils/crypto";
import { Spinner } from "./components/common/Spinner";

const App = () => {
const [token, setToken] = useLocalStorage("token");
Expand All @@ -20,7 +22,8 @@ const App = () => {
});

if (token !== null) {
rootAPI.defaults.headers.common["Authorization"] = "Bearer " + token;
rootAPI.defaults.headers.common["Authorization"] =
"Bearer " + aesDecrypt(token);
}

const preload = async () => {
Expand All @@ -36,7 +39,7 @@ const App = () => {
profilePhoto: data.image,
userName: data.fullName,
});
setAuth({ isLogIn: true, token: token });
setAuth({ isLogIn: true, token: aesDecrypt(token) });
}
}
};
Expand All @@ -53,7 +56,7 @@ const App = () => {
prepare();
}, [isLogIn, token]);

if (isLoading) return null;
if (isLoading) return <Spinner />;

return (
<>
Expand Down
7 changes: 7 additions & 0 deletions src/api/queries/createChannel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { _POST } from "@/api";
import { ICreateChannelParams } from "@/types/channel";

export const _CREATE_CHANNEL = async (params: ICreateChannelParams) => {
const result = await _POST("/channels/create", params);
return result?.data;
};
26 changes: 26 additions & 0 deletions src/components/Admin/Admin.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { useMe } from "@/hooks/useMe";
import { Button } from "../common";
import { useUI } from "../common/uiContext";

const { VITE_ADMIN_ID } = import.meta.env;

const Admin = () => {
const { id } = useMe();
const { setModalView, openModal } = useUI();

const onClick = () => {
setModalView("CREATE_CHANNEL_VIEW");
openModal();
};

if (id === VITE_ADMIN_ID)
return (
<div style={{ margin: "10px 5px", marginBottom: "0" }}>
<Button variant="symbol" onClick={onClick}>
<span style={{ fontWeight: "bold" }}>์ฑ„๋„ ์ถ”๊ฐ€ํ•˜๊ธฐ</span>
</Button>
</div>
);
};

export default Admin;
1 change: 1 addition & 0 deletions src/components/Admin/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as Admin } from "./Admin";
63 changes: 37 additions & 26 deletions src/components/SearchTab/index.tsx
Original file line number Diff line number Diff line change
@@ -1,45 +1,56 @@
import { NAV_HEIGHT } from "@/constants/uiConstants";
import { Row } from "@/styles/GlobalStyle";
import { styled } from "styled-components";
import { Button } from "../common";
import { useState } from "react";

const TabWrap = styled(Row)`
margin-top: 1rem;
height: ${`${NAV_HEIGHT - 1}rem`};
`;

const Tab = styled.div<{ option: TOption }>`
background-color: ${({ theme }) => theme.gray_200};
flex-grow: 1;
text-align: center;
line-height: ${`${NAV_HEIGHT - 1}rem`};
cursor: pointer;
&:first-of-type {
border-right: 2px solid ${({ theme }) => theme.white_primary};
background-color: ${({ theme, option }) =>
option === "user" ? theme.gray_500 : undefined};
}
&:last-of-type {
background-color: ${({ theme, option }) =>
option === "post" ? theme.gray_500 : undefined};
}
`;

type TOption = "user" | "post";

interface ISearchTab {
option: TOption;
onClick: () => void;
onClick: (tabOption: string) => void;
}

const SearchTab = ({ option = "user", onClick, ...props }: ISearchTab) => {
const [tab, setTab] = useState(option);

const onClickTab = () => {
const newTabOption = tab === "user" ? "post" : "user";
setTab(newTabOption);
onClick(newTabOption);
};

return (
<TabWrap {...props}>
<Tab option={option} onClick={onClick}>
{"์‚ฌ์šฉ์ž"}
</Tab>
<Tab option={option} onClick={onClick}>
{"๊ฒŒ์‹œ๊ธ€"}
</Tab>
<Button
variant={tab === "user" ? "symbol" : "disabled"}
type="button"
width="50vh"
style={{
borderTopRightRadius: 0,
borderBottomRightRadius: 0,
pointerEvents: tab === "user" ? "none" : undefined,
}}
onClickHandler={() => onClickTab()}
>
์‚ฌ์šฉ์ž
</Button>
<Button
variant={tab === "post" ? "symbol" : "disabled"}
type="button"
width="50vh"
style={{
borderTopLeftRadius: 0,
borderBottomLeftRadius: 0,
pointerEvents: tab === "post" ? "none" : undefined,
}}
onClickHandler={() => onClickTab()}
>
๊ฒŒ์‹œ๊ธ€
</Button>
</TabWrap>
);
};
Expand Down
4 changes: 3 additions & 1 deletion src/components/common/Avatar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import styled from "styled-components";

type TShape = "circle" | "round" | "square";
type TSize = "XXS" | "XS" | "S" | "M" | "L" | "XL";

interface IAvatarProps {
size: string;
size: TSize;
shape?: TShape;
src?: string;
theme?: string;
Expand All @@ -17,6 +18,7 @@ const ShapeToStyle: { [key: string]: string } = {
};

const SizeToStyle: { [key: string]: string } = {
XXS: "26px",
XS: "32px",
S: "40px",
M: "48px",
Expand Down
6 changes: 5 additions & 1 deletion src/components/common/Button/Button.styles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import styled from "styled-components";
import tw from "twin.macro";

import { BORDER_TINE_WIDTH } from "@/constants/uiConstants";

const ButtonBaseWrapper = styled.button<any>`
position: relative;
overflow: hidden;
Expand Down Expand Up @@ -38,8 +40,10 @@ export const Flat = styled(ButtonBaseWrapper)<any>`

export const Neumorp = styled(ButtonBaseWrapper)<any>`
background-color: ${props => props.theme.white_primary + 30};
border-width: ${BORDER_TINE_WIDTH}px;
border-color: ${props => props.theme.transparent_30};
color: ${props =>
props.$textColor ? props.$textColor : props.theme.text_primary_color};
props.$textColor ? props.$textColor : props.theme.text_primary_color};
${tw`flex justify-center items-center shadow-md hover:shadow-inner transition-shadow`}
`;
Expand Down
3 changes: 1 addition & 2 deletions src/components/common/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,10 @@ const Button: React.FC<ButtonProps> = forwardRef((props, buttonRef) => {
$rippleColor={rippleColor}
{...rest}
>
{children}
{!loading ? <>{children}</> : <span className="font-semibold">...</span>}
{useRipple && variant !== "neumorp" && !disabled && (
<ButtonRipple ref={rippleRef} className="ripple" />
)}
{loading && <i className="pl-2 m-0 flex">{/* <LoadingDots /> */}</i>}
</ButtonWrapper>
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const AvatarWrapper = styled.div`
`;

const PartnerName = styled.span`
font-size: 0.5rem;
font-size: 0.7rem;
font-weight: 500;
margin: 0.15rem auto 0 auto;
`;
Expand All @@ -42,9 +42,9 @@ const ChatAvatars = ({
<ChatAvatarsWrapper>
<AvatarsWrapper>
<AvatarWrapper>
<Avatar size="XS" shape="circle" src={partnerAvatarSrc} />
<Avatar size="XXS" shape="circle" src={partnerAvatarSrc} />
</AvatarWrapper>
<Avatar size="XS" shape="circle" src={myAvatarSrc} />
<Avatar size="XXS" shape="circle" src={myAvatarSrc} />
</AvatarsWrapper>
<PartnerName>{partnerName}</PartnerName>
</ChatAvatarsWrapper>
Expand Down
Loading

0 comments on commit 75a22c2

Please sign in to comment.