Skip to content

Commit 8274a46

Browse files
committed
improved project structure
1 parent 48ccf50 commit 8274a46

File tree

16 files changed

+101
-128
lines changed

16 files changed

+101
-128
lines changed

package-lock.json

Lines changed: 83 additions & 109 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"dependencies": {
1313
"@next/font": "13.1.6",
1414
"antd": "^5.3.1",
15-
"axios": "^0.21.4",
16-
"axios-cache-adapter": "^2.7.3",
15+
"axios": "^1.0.0",
16+
"axios-cache-interceptor": "^1.5.3",
1717
"eslint": "8.33.0",
1818
"eslint-config-next": "13.1.6",
1919
"fast-querystring": "^1.1.1",

src/cacheAxios.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { setup } from 'axios-cache-adapter'
1+
import Axios from 'axios'
2+
import { setupCache } from 'axios-cache-interceptor'
23

3-
const api = setup({
4-
baseURL: 'https://codeforces.com/api',
5-
cache: {
6-
exclude: { query: false }
7-
}
8-
})
4+
const instance = Axios.create({
5+
baseURL: 'https://codeforces.com/api',
6+
});
7+
const api = setupCache(instance)
98

109
export default api

src/hooks/option.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useCallback, useState } from 'react';
22
import qs from 'fast-querystring';
33

4-
import Error from "../assets/images/error.svg"
4+
import Error from "../images/error.svg"
55

66
const defaultOption = {
77
username: "redheadphone",
File renamed without changes.
File renamed without changes.

src/pages/_app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import dynamic from 'next/dynamic'
22
import Head from 'next/head'
3-
import '@/styles/globals.css'
3+
import './styles.css'
44

55
function App({ Component, pageProps }) {
66
return <>

src/pages/api/badge.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import path from "path";
55
import { get_color_from_rating, CONSTANTS, clamp_value } from "../../common.js";
66

77
export function renderBadge(rating) {
8-
nunjucks.configure(path.join(process.cwd(), "src/template"), {
8+
nunjucks.configure(path.join(process.cwd(), "src/templates"), {
99
autoescape: true,
1010
});
1111
return nunjucks.render("badge.svg", {

src/pages/api/card.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function renderCard(
4444
disable_animations,
4545
show_icons
4646
) {
47-
nunjucks.configure(path.join(process.cwd(), "src/template"), {
47+
nunjucks.configure(path.join(process.cwd(), "src/templates"), {
4848
autoescape: true,
4949
});
5050
return nunjucks.render("card.svg", {

src/pages/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { GithubFilled, BookFilled, ExportOutlined } from '@ant-design/icons';
55
import { Space, Card, Col, Form, Input, Select, Radio, Button, Divider, Row } from "antd";
66

77
import themes from "../themes.js";
8-
import Logo from "../assets/images/logo.png";
8+
import Logo from "../images/logo.png";
99
import useOption from "../hooks/option.js";
1010

1111

0 commit comments

Comments
 (0)