Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[이찬주] week14 #425

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
{
"extends": "next/core-web-vitals"
"root": true,
"env": { "browser": true, "es6": true, "node": true },
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json"
},
"extends": [
"plugin:@next/next/recommended",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/recommended",
"plugin:jsx-a11y/recommended",
"plugin:prettier/recommended",
"prettier"
],
"settings": {
"react": {
"version": "detect"
},
"import/resolver": {
"typescript": {}
}
},
"plugins": ["prettier", "@typescript-eslint", "import", "simple-import-sort"],
"rules": {
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error"
}
}
Empty file modified README.md
100644 → 100755
Empty file.
13 changes: 11 additions & 2 deletions next.config.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
}
webpack: (config) => {
config.module.rules.push({
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: ["@svgr/webpack"],
});

module.exports = nextConfig
return config;
},
};

module.exports = nextConfig;
4 changes: 2 additions & 2 deletions package-lock.json
100644 → 100755

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

19 changes: 15 additions & 4 deletions package.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "fe-weekly-mission",
"name": "weekly-mission-nextjs",
"version": "0.1.0",
"private": true,
"scripts": {
Expand All @@ -9,16 +9,27 @@
"lint": "next lint"
},
"dependencies": {
"axios": "^1.6.2",
"classnames": "^2.3.2",
"date-fns": "^2.30.0",
"next": "13.5.6",
"react": "^18",
"react-dom": "^18",
"next": "13.5.6"
"react-hook-form": "^7.48.2"
},
"devDependencies": {
"typescript": "^5",
"@svgr/webpack": "^8.1.0",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@typescript-eslint/parser": "^6.19.0",
"eslint": "^8",
"eslint-config-next": "13.5.6"
"eslint-config-next": "13.5.6",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"sass": "^1.69.5",
"typescript": "^5"
}
}
6 changes: 3 additions & 3 deletions pages/_app.tsx
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import '@/styles/globals.css'
import type { AppProps } from 'next/app'
import "@/styles/reset.css";
import type { AppProps } from "next/app";

export default function App({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
return <Component {...pageProps} />;
}
Empty file modified pages/_document.tsx
100644 → 100755
Empty file.
13 changes: 0 additions & 13 deletions pages/api/hello.ts

This file was deleted.

40 changes: 40 additions & 0 deletions pages/folder/[folderId].jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { useGetFolders } from "@/src/folder/data-access-folder";
import { useGetLinks } from "@/src/link/data-access-link";
import { Layout } from "@/src/sharing/feature-layout";
import { FolderLayout } from "@/src/page-layout/FolderLayout";
import { FolderToolBar } from "@/src/folder/feature-folder-tool-bar";
import { SearchBar } from "@/src/link/ui-search-bar";
import { useState } from "react";
import { ALL_LINKS_ID } from "@/src/link/data-access-link/constant";
import { LinkForm } from "@/src/link/feature-link-form";
import { CardList } from "@/src/link/feature-card-list";
import { SelectedFolderId } from "@/src/folder/type";
import { useSearchLink } from "@/src/link/util-search-link";
import { useIntersectionObserver } from "@/src/sharing/util";

const FolderPage = () => {
return (
<Layout isSticky={false} footerRef={ref}>
<FolderLayout
linkForm={<LinkForm hideFixedLinkForm={isIntersecting} />}
searchBar={
<SearchBar
value={searchValue}
onChange={handleChange}
onCloseClick={handleCloseClick}
/>
}
folderToolBar={
<FolderToolBar
folders={folders}
selectedFolderId={selectedFolderId}
onFolderClick={setSelectedFolderId}
/>
}
cardList={loading ? null : <CardList links={result} />}
/>
</Layout>
);
};

export default FolderPage;
42 changes: 42 additions & 0 deletions pages/folder/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { useGetFolders } from "@/src/folder/data-access-folder";
import { useGetLinks } from "@/src/link/data-access-link";
import { Layout } from "@/src/sharing/feature-layout";
import { FolderLayout } from "@/src/page-layout/FolderLayout";
import { FolderToolBar } from "@/src/folder/feature-folder-tool-bar";
import { SearchBar } from "@/src/link/ui-search-bar";
import { useState } from "react";
import { ALL_LINKS_ID } from "@/src/link/data-access-link/constant";
import { LinkForm } from "@/src/link/feature-link-form";
import { CardList } from "@/src/link/feature-card-list";
import { SelectedFolderId } from "@/src/folder/type";
import { useSearchLink } from "@/src/link/util-search-link";
import { useIntersectionObserver } from "@/src/sharing/util";

const FolderPage = () => {
const { data: folders } = useGetFolders();
const [selectedFolderId, setSelectedFolderId] = useState<SelectedFolderId>(ALL_LINKS_ID);
const { data: links, loading } = useGetLinks(selectedFolderId);
const { searchValue, handleChange, handleCloseClick, result } = useSearchLink(links);
const { ref, isIntersecting } = useIntersectionObserver<HTMLDivElement>();

return (
<Layout isSticky={false} footerRef={ref}>
<FolderLayout
linkForm={<LinkForm hideFixedLinkForm={isIntersecting} />}
searchBar={
<SearchBar value={searchValue} onChange={handleChange} onCloseClick={handleCloseClick} />
}
folderToolBar={
<FolderToolBar
folders={folders}
selectedFolderId={selectedFolderId}
onFolderClick={setSelectedFolderId}
/>
}
cardList={loading ? null : <CardList links={result} />}
/>
</Layout>
);
};

export default FolderPage;
113 changes: 8 additions & 105 deletions pages/index.tsx
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,114 +1,17 @@
import Head from 'next/head'
import Image from 'next/image'
import { Inter } from 'next/font/google'
import styles from '@/styles/Home.module.css'
import Head from "next/head";
import Image from "next/image";
import { Inter } from "next/font/google";
import styles from "@/styles/Home.module.css";

const inter = Inter({ subsets: ['latin'] })
const inter = Inter({ subsets: ["latin"] });

export default function Home() {
return (
<>
<Head>
<title>Create Next App</title>
<meta name="description" content="Generated by create next app" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/favicon.ico" />
<title>Linkbrary</title>
</Head>
<main className={`${styles.main} ${inter.className}`}>
<div className={styles.description}>
<p>
Get started by editing&nbsp;
<code className={styles.code}>pages/index.tsx</code>
</p>
<div>
<a
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
By{' '}
<Image
src="/vercel.svg"
alt="Vercel Logo"
className={styles.vercelLogo}
width={100}
height={24}
priority
/>
</a>
</div>
</div>

<div className={styles.center}>
<Image
className={styles.logo}
src="/next.svg"
alt="Next.js Logo"
width={180}
height={37}
priority
/>
</div>

<div className={styles.grid}>
<a
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
className={styles.card}
target="_blank"
rel="noopener noreferrer"
>
<h2>
Docs <span>-&gt;</span>
</h2>
<p>
Find in-depth information about Next.js features and&nbsp;API.
</p>
</a>

<a
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
className={styles.card}
target="_blank"
rel="noopener noreferrer"
>
<h2>
Learn <span>-&gt;</span>
</h2>
<p>
Learn about Next.js in an interactive course with&nbsp;quizzes!
</p>
</a>

<a
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
className={styles.card}
target="_blank"
rel="noopener noreferrer"
>
<h2>
Templates <span>-&gt;</span>
</h2>
<p>
Discover and deploy boilerplate example Next.js&nbsp;projects.
</p>
</a>

<a
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
className={styles.card}
target="_blank"
rel="noopener noreferrer"
>
<h2>
Deploy <span>-&gt;</span>
</h2>
<p>
Instantly deploy your Next.js site to a shareable URL
with&nbsp;Vercel.
</p>
</a>
</div>
</main>
<main></main>
</>
)
);
}
Loading