Skip to content

Commit

Permalink
[πŸ”€ merge] develop <- main
Browse files Browse the repository at this point in the history
  • Loading branch information
eeeyooon committed Apr 9, 2024
2 parents 02bd523 + feb0abc commit fcf3840
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 18 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/develop_waved-fe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,13 @@ jobs:

- name: Unzip artifact for deployment
run: unzip release.zip

- name: Login to Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID }}

subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID }}

- name: 'Deploy to Azure Web App'
id: deploy-to-webapp
Expand All @@ -87,4 +86,4 @@ jobs:
NEXT_PUBLIC_LOGIN_URL: ${{ secrets.NEXT_PUBLIC_LOGIN_URL }}
NEXT_PUBLIC_CLIENT_BASE_URL: ${{ secrets.NEXT_PUBLIC_CLIENT_BASE_URL }}
NEXT_PUBLIC_ADMIN_BASE_URL: ${{ secrets.NEXT_PUBLIC_ADMIN_BASE_URL }}
NEXT_PUBLIC_IMAGE_TOKEN: ${{ secrets.NEXT_PUBLIC_IMAGE_TOKEN }}
NEXT_PUBLIC_IMAGE_TOKEN: ${{ secrets.NEXT_PUBLIC_IMAGE_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ next-env.d.ts
# pwa
sw.js
workbox-*.js
sw.js.map
workbox-*.js.map
13 changes: 8 additions & 5 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import withPWA from 'next-pwa';

const prod = process.env.NODE_ENV === 'production';
const isProd = process.env.NODE_ENV === 'production';

const pwaConfig = withPWA({
dest: 'public',
disable: !isProd,
runtimeCaching: [],
});

/** @type {import('next').NextConfig} */
const nextConfig = {
Expand All @@ -21,7 +27,4 @@ const nextConfig = {
},
};

export default withPWA({
dest: 'public',
disable: prod ? false : true,
})(nextConfig);
export default pwaConfig(nextConfig);
16 changes: 10 additions & 6 deletions src/components/common/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import styled from '@emotion/styled';
import Image from 'next/image';
import { useRouter } from 'next/router';
import { getCookie } from 'cookies-next';
import {
homeNormal,
homeFilled,
Expand All @@ -14,17 +13,22 @@ import {
} from '../../../public/icons';
import screenSize from '@/constants/screenSize';

export default function Footer() {
interface IFooterProps {
isLogined: boolean;
}

export default function Footer({ isLogined }: IFooterProps) {
const router = useRouter();
const cookieToken = getCookie('accessToken');
// const cookieToken = getCookie('accessToken');
// const isLogined = !!cookieToken;

const navigate = (
e: React.MouseEvent<HTMLElement, MouseEvent>,
path: string,
) => {
e.preventDefault();

if (!cookieToken && path === '/mychallenge') {
if (!isLogined && path === '/mychallenge') {
return;
}

Expand All @@ -50,11 +54,11 @@ export default function Footer() {
<SFooterNavLink onClick={(e) => navigate(e, '/mychallenge')}>
<SMyChallengeNavItem
isActive={router.pathname === '/mychallenge'}
isLogined={cookieToken !== null}
isLogined={isLogined}
>
<Image
src={
cookieToken !== null
isLogined
? router.pathname === '/mychallenge'
? myChallengeFilled
: myChallengeNormal
Expand Down
4 changes: 3 additions & 1 deletion src/components/common/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ interface ILayout {
noHeader?: boolean;
withBottomFixedBtn?: boolean;
rightOnClick?: () => void;
isLogined?: boolean;
}

export default function Layout({
Expand All @@ -27,6 +28,7 @@ export default function Layout({
noHeader,
withBottomFixedBtn,
rightOnClick,
isLogined,
}: ILayout) {
return (
<SLayoutWrapper
Expand Down Expand Up @@ -55,7 +57,7 @@ export default function Layout({
/>
)}
<main>{children}</main>
{noFooter || <Footer />}
{noFooter || <Footer isLogined={isLogined !== undefined && isLogined} />}
</SLayoutWrapper>
);
}
Expand Down
4 changes: 3 additions & 1 deletion src/pages/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ export default function Home({
const currentTime = Date.now();
const timeUntilExpiry = expiresTime - currentTime;

console.log(timeUntilExpiry);

if (timeUntilExpiry < 60000) {
setReadyReconnect(true);
}
Expand Down Expand Up @@ -238,7 +240,7 @@ export default function Home({
)}
</main>
<FloatingBtn type={isLogined ? 'challengeRequest' : 'register'} />
<Footer />
<Footer isLogined={isLogined} />
</SHomeWrapper>
);
}
Expand Down
7 changes: 7 additions & 0 deletions src/pages/mychallenge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useRouter } from 'next/router';
import Link from 'next/link';
import styled from '@emotion/styled';
import axios from 'axios';
import { getCookie } from 'cookies-next';
import REVIEW_SNACKBAR_TEXT from '@/constants/reviewSnackBarText';
import ISnackBarState from '@/types/snackbar';
import { TMyChallengeInfo } from '@/types/myChallenge';
Expand All @@ -22,6 +23,7 @@ interface IMyChallenges {
getMyCompletedChallenges?: TMyChallengeInfo[];
requireSnackBar?: boolean;
errorMsg?: string;
isLogined: boolean;
}

export default function MyChallenge({
Expand All @@ -30,6 +32,7 @@ export default function MyChallenge({
getMyCompletedChallenges,
requireSnackBar,
errorMsg,
isLogined,
}: IMyChallenges) {
const [completedData, setCompletedData] = useState<TMyChallengeInfo[]>(
getMyCompletedChallenges || [],
Expand Down Expand Up @@ -134,6 +137,7 @@ export default function MyChallenge({
headerText="MY μ±Œλ¦°μ§€"
title="λ§ˆμ΄μ±Œλ¦°μ§€"
description="λ‚˜μ˜ μ±Œλ¦°μ§€ 내역을 ν™•μΈν•΄λ³΄μ„Έμš”."
isLogined={isLogined}
>
<TabMenu
tabs={[
Expand Down Expand Up @@ -182,6 +186,8 @@ export default function MyChallenge({

async function getServerSidePropsFunction(context: GetServerSidePropsContext) {
const serverInstance = createServerInstance(context);
const cookieToken = getCookie('accessToken', context);
const isLogined = !!cookieToken;

const fetchMyChallenges = async (status: string) => {
const response = await serverInstance.get<TMyChallengeInfo[]>(
Expand All @@ -201,6 +207,7 @@ async function getServerSidePropsFunction(context: GetServerSidePropsContext) {
getMyProgressChallenges: myProgressChallenges,
getMyWaitingChallenges: myWaitingChallenges,
getMyCompletedChallenges: myCompletedChallenges,
isLogined,
},
};
}
Expand Down
3 changes: 2 additions & 1 deletion src/pages/profile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export default function Profile({
noHeader
title="ν”„λ‘œν•„"
description="WAVED νšŒμ›μ˜ ν”„λ‘œν•„ νŽ˜μ΄μ§€μž…λ‹ˆλ‹€. μ±Œλ¦°μ§€ 기둝, 계정 μ„€μ •, 고객 μ„Όν„° 등을 확인할 수 μžˆμŠ΅λ‹ˆλ‹€. "
isLogined={isLogined}
>
<SProfileWrapper>
<h2 className="a11yHidden">ν”„λ‘œν•„</h2>
Expand Down Expand Up @@ -370,7 +371,7 @@ export default function Profile({
<SProfileEtc>
<div>
<p>ν˜„μž¬ 버전</p>
<p>1.0.2</p>
<p>1.0.1</p>
</div>
</SProfileEtc>
<SwithdrawalBtnWrapper>
Expand Down

0 comments on commit fcf3840

Please sign in to comment.