diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..eadf3ad --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,37 @@ +name: Auto Deploy after push + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-18.04 + steps: + - name: Checkout source code + uses: actions/checkout@master + + - name: Cache node modules # node modules 캐싱 + uses: actions/cache@v1 + with: + path: node_modules + key: ${{ runner.OS }}-master-build-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.OS }}-build- + ${{ runner.OS }}- + + - name: Install Dependencies + run: npm install + + - name: Build + run: npm run build + env: + CI: "" + + - name: Deploy + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + run: | + aws s3 sync --region ap-northeast-2 ./dist s3://picpic-bucket diff --git a/src/assets/frame-F1FFAD.png b/src/assets/frame-F1FFAD.png index 93c902e..f3d74f5 100644 Binary files a/src/assets/frame-F1FFAD.png and b/src/assets/frame-F1FFAD.png differ diff --git a/src/assets/frame-FFFDBA.png b/src/assets/frame-FFFDBA.png index abd89f3..d23e5d4 100644 Binary files a/src/assets/frame-FFFDBA.png and b/src/assets/frame-FFFDBA.png differ diff --git a/src/assets/main-logo.png b/src/assets/main-logo.png new file mode 100644 index 0000000..666192f Binary files /dev/null and b/src/assets/main-logo.png differ diff --git a/src/component/AllFrameCpn/FrameList.jsx b/src/component/AllFrameCpn/FrameList.jsx index c591002..bb32edd 100644 --- a/src/component/AllFrameCpn/FrameList.jsx +++ b/src/component/AllFrameCpn/FrameList.jsx @@ -3,24 +3,29 @@ import styles from "./FrameList.module.css"; import axios from "axios"; import { Link } from "react-router-dom"; // import { getAllFrames } from "../../apis/getFrame"; -import { useAtom } from 'jotai'; -import { accessTokenAtom } from '../../store/jotaiAtoms'; +import { useAtom } from "jotai"; +import { accessTokenAtom } from "../../store/jotaiAtoms"; const FrameList = () => { const [frames, setFrames] = useState([]); const [accessToken, setAccessToken] = useAtom(accessTokenAtom); + useEffect(() => { // 액세스 토큰이 있을 때만 API 요청을 보내도록 조건 처리 if (accessToken) { - console.log('Framelist ACT:', accessToken); // accessToken jotai에서 잘 불러오는지 확인 + console.log("Framelist ACT:", accessToken); // accessToken jotai에서 잘 불러오는지 확인 // axios 요청 설정 const config = { headers: { Authorization: `Bearer ${accessToken}`, // 헤더에 accessToken을 추가 }, }; - // API 요청 보내기 - axios.get('http://ec2-3-35-208-177.ap-northeast-2.compute.amazonaws.com:8080/frame/frameList', config) + // API 요청 보내기 + axios + .get( + "http://ec2-3-35-208-177.ap-northeast-2.compute.amazonaws.com:8080/frame/list", + config + ) .then((res) => { console.log(res.data); // 성공적으로 데이터를 받아온 경우 @@ -28,10 +33,10 @@ const FrameList = () => { }) .catch((err) => { // 오류 처리 - console.error('API 요청 중 오류 발생:', err); + console.error("API 요청 중 오류 발생:", err); }); - } - }, [accessToken]); // useEffect가 실행되는 조건을 accessToken이 변경될 때로 설정 + } + }, [accessToken]); // useEffect가 실행되는 조건을 accessToken이 변경될 때로 설정 return (
@@ -39,19 +44,27 @@ const FrameList = () => {
- + {frames.length === null ? ( // frames 배열이 비어 있는 경우 +
+

새 프레임을 추가해주세요

+
+ ) : ( + // frames 배열에 프레임이 있는 경우 + + )}
); diff --git a/src/component/AllFrameCpn/FrameList.module.css b/src/component/AllFrameCpn/FrameList.module.css index 6e0324c..364e8cc 100644 --- a/src/component/AllFrameCpn/FrameList.module.css +++ b/src/component/AllFrameCpn/FrameList.module.css @@ -1,3 +1,9 @@ +ul { + list-style-type: none; + margin: 0px; + padding: 0px; +} + .FrameList { width: 390px; height: 689px; @@ -19,3 +25,39 @@ border-radius: 10px; border-color: #009eff; } + +.FrameScroll { + height: 619px; +} + +.InfoMsg { + height: 100%; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} + +.FrameUl { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + flex-wrap: wrap; /* 너비를 넘어가면 다음 줄로 넘어감 */ +} + +.FrameItem { + width: calc(40% - 10px); + gap: 10px; + margin: 20px 10px; +} + +.FrameItem button { + background: #ffffff; + border: none; +} + +.FrameImage { + width: 100%; + height: auto; +} diff --git a/src/component/MakeFrameCpn/Background.module.css b/src/component/MakeFrameCpn/Background.module.css index 8b0128e..536ecb1 100644 --- a/src/component/MakeFrameCpn/Background.module.css +++ b/src/component/MakeFrameCpn/Background.module.css @@ -5,7 +5,7 @@ .ListTop { height: 40px; - padding: 14px 14px 14px 18px; + padding: 10px; display: flex; flex-direction: row; justify-content: center; @@ -22,17 +22,17 @@ .ListView { width: 100%; height: 160px; - padding: 15px 0px 15px 18px; + padding: 10px 0px; display: flex; flex-direction: column; justify-content: center; - gap: 18px; + gap: 30px; } .FirstLine { display: flex; flex-direction: row; - justify-content: space-around; + justify-content: space-evenly; } .FirstLine button { @@ -60,7 +60,7 @@ .SecondLine { display: flex; flex-direction: row; - justify-content: space-around; + justify-content: space-evenly; } .SecondLine button { diff --git a/src/component/MakeFrameCpn/Sticker.jsx b/src/component/MakeFrameCpn/Sticker.jsx index d61ac2e..c65531a 100644 --- a/src/component/MakeFrameCpn/Sticker.jsx +++ b/src/component/MakeFrameCpn/Sticker.jsx @@ -16,7 +16,7 @@ const Sticker = ({ handleStickerSelect }) => { const fetchStickers = async (theme) => { try { const res = await axios.get( - `http://ec2-3-35-208-177.ap-northeast-2.compute.amazonaws.com:8080/frame/get/sticker/${theme}` + `http://ec2-3-35-208-177.ap-northeast-2.compute.amazonaws.com:8080/frame/stickerList/${theme}` ); const imageStickers = res.data.filter((url, index) => index !== 0); console.log("이미지 URL 리스트:", imageStickers); diff --git a/src/component/MakeFrameCpn/Template.jsx b/src/component/MakeFrameCpn/Template.jsx index 0417cb2..385228a 100644 --- a/src/component/MakeFrameCpn/Template.jsx +++ b/src/component/MakeFrameCpn/Template.jsx @@ -13,12 +13,7 @@ const Template = ({ changeFrameImage }) => { return (
- - - - - - +
-
diff --git a/src/pages/Frame/Frame.module.css b/src/pages/Frame/Frame.module.css index b649fe0..81c1031 100644 --- a/src/pages/Frame/Frame.module.css +++ b/src/pages/Frame/Frame.module.css @@ -95,7 +95,7 @@ background: #f7f8f8; display: flex; flex-direction: row; - justify-content: center; + justify-content: space-evenly; align-items: center; gap: 20px; } diff --git a/src/pages/Main/Main.jsx b/src/pages/Main/Main.jsx index 9c5028b..ef7d98b 100644 --- a/src/pages/Main/Main.jsx +++ b/src/pages/Main/Main.jsx @@ -1,12 +1,15 @@ -import styles from './Main.module.scss' -import { Link } from 'react-router-dom' +import styles from "./Main.module.scss"; +import { Link } from "react-router-dom"; +import main_logo from "../../assets/main-logo.png"; export default function Login() { return ( <> - - + + ); -} \ No newline at end of file +} diff --git a/src/pages/Main/Main.module.scss b/src/pages/Main/Main.module.scss index e69de29..4ab1833 100644 --- a/src/pages/Main/Main.module.scss +++ b/src/pages/Main/Main.module.scss @@ -0,0 +1,10 @@ +.linkBtn { + background-color: #ffffff; + border: none; + + img { + width: 50%; + height: 50%; + display: inline-flex; + } +}