Skip to content
Snippets Groups Projects
Commit c1f2b4f1 authored by 화균 김's avatar 화균 김
Browse files

remove: delete unused files

parent 0898f6d5
Branches
No related tags found
No related merge requests found
Showing
with 0 additions and 3370 deletions
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
## Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
```js
export default tseslint.config({
extends: [
// Remove ...tseslint.configs.recommended and replace with this
...tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
...tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
...tseslint.configs.stylisticTypeChecked,
],
languageOptions: {
// other options...
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
})
```
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
```js
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default tseslint.config({
plugins: {
// Add the react-x and react-dom plugins
'react-x': reactX,
'react-dom': reactDom,
},
rules: {
// other rules...
// Enable its recommended typescript rules
...reactX.configs['recommended-typescript'].rules,
...reactDom.configs.recommended.rules,
},
})
```
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
)
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
This diff is collapsed.
{
"name": "aj_lib_phrase",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"@types/styled-components": "^5.1.34",
"axios": "^1.8.4",
"googleapis": "^148.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"styled-components": "^6.1.17",
"vite-plugin-ssr": "^0.4.142"
},
"devDependencies": {
"@eslint/js": "^9.21.0",
"@types/node": "^22.14.0",
"@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^9.21.0",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.19",
"globals": "^15.15.0",
"typescript": "~5.7.2",
"typescript-eslint": "^8.24.1",
"vite": "^6.2.0"
}
}
reference/public/ajoulib_bottom_logo.png

6.42 KiB

reference/public/ajoulib_logo.png

4.45 KiB

reference/public/ajoulib_logo_4x.png

18.7 KiB

reference/public/ajoulib_reading_chito.png

248 KiB

File deleted
reference/public/quota_close.png

725 B

reference/public/quota_open.png

662 B

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
\ No newline at end of file
import styled from "styled-components";
export const GlobalSection = styled.section`
width: 100vw;
height: 100vh;
position: relative;
background-color:rgb(250, 250, 250);
`;
export const AppSection = styled.section`
width: calc(100% - 1.5rem);
max-width: 500px;
height: calc(100% - 1.5rem);
padding: 0;
background-color: #fefefe;
border-radius: 1rem;
border: 1px solid #eaeaea;
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
`;
\ No newline at end of file
import { useState } from 'react'
import ContentWrap from './components/client/ContentWrap'
import { GlobalSection, AppSection } from './App.style'
function App() {
return <GlobalSection>
<AppSection>
<ContentWrap/>
</AppSection>
</GlobalSection>
}
export default App
'use server';
import { cache } from 'react';
export const getSentence = cache(async (): Promise<any[]> => {
try {
const spreadsheetId = import.meta.env.VITE_SHEET_ID;
const range = 'C:G';
// Google OAuth2 토큰 가져오기
const tokenResponse = await fetch('https://oauth2.googleapis.com/token', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
client_id: import.meta.env.VITE_GOOGLE_CLIENT_ID,
client_secret: import.meta.env.VITE_GOOGLE_CLIENT_SECRET,
refresh_token: import.meta.env.VITE_GOOGLE_REFRESH_TOKEN,
grant_type: 'refresh_token',
}),
});
const { access_token } = await tokenResponse.json();
// Google Sheets API 호출
const response = await fetch(
`https://sheets.googleapis.com/v4/spreadsheets/${spreadsheetId}/values/${range}`,
{
headers: {
'Authorization': `Bearer ${access_token}`,
},
}
);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
const rows = data.values;
if (!rows || rows.length === 0) {
throw new Error('데이터가 없습니다.');
}
// 데이터 가공
return rows.slice(1).map((row: any) => ({
columnC: row[0] || '',
columnD: row[1] || '',
columnE: row[2] || '',
columnF: row[3] || '',
columnG: row[4] || '',
}));
} catch (error) {
console.error('Google Sheets API 요청 실패:', error);
throw error;
// throw new Error('시트 데이터를 가져오는데 실패했습니다.');
}
});
\ No newline at end of file
.logo-container {
display: flex;
justify-content: center;
align-items: center;
padding: 1rem;
}
.logo-image {
max-width: 200px;
height: auto;
object-fit: contain;
}
\ No newline at end of file
import React from 'react';
import styles from './Logo.module.css';
const Logo: React.FC = () => {
return (
<div className={styles.logoContainer}>
{/* 방법 1: 절대 경로 사용 */}
<img
src="/ajoulib_logo_4x.png"
alt="아주대학교 도서관 로고"
className={styles.logoImage}
/>
{/* 방법 2: import 사용 */}
{/* import logo from '/ajoulib_logo_4x.png';
<img
src={logo}
alt="아주대학교 도서관 로고"
className="logo-image"
/> */}
</div>
);
};
export default Logo;
\ No newline at end of file
import * as S from "./style";
import top_logo from "/ajoulib_logo_4x.png";
import bottom_logo from "/ajoulib_bottom_logo.png";
import reading_chito from "/ajoulib_reading_chito.png";
import TextArea from "../../server/TextArea";
// 서버 컴포넌트는 async 함수로 선언합니다
export default function ServerComponent() {
return (
<S.StyledSection>
<S.TopLogo src={top_logo} alt="AjouLib Logo" />
<S.PageTitle>오늘의 한 문장</S.PageTitle>
<S.ScrollSection>
<TextArea/>
</S.ScrollSection>
<S.DesignBackground/>
<S.BottomLogo src={bottom_logo} alt="AjouLib Logo" />
<S.CharacterImg src={reading_chito} alt="AjouLib Chito" />
</S.StyledSection>
)
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment