Skip to content

Commit 3b34282

Browse files
authored
Merge pull request #11 from junekimdev/replace-state-management
Replace state management
2 parents b744d1a + 4400a86 commit 3b34282

File tree

20 files changed

+1481
-1878
lines changed

20 files changed

+1481
-1878
lines changed

.eslintignore

Lines changed: 0 additions & 44 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 51 deletions
This file was deleted.

codegen-util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const snakeCaseCap = (string) => {
1616
/********************
1717
* User Input Inquirer
1818
********************/
19-
const readline = require('readline');
19+
const readline = require('node:readline');
2020
/**
2121
* @param {string} query
2222
* @returns {Promise<string>}

codegen.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const fs = require('fs');
2-
const path = require('path');
1+
const fs = require('node:fs');
2+
const path = require('node:path');
33
const ejs = require('ejs');
44
const { getArgs, askQuestion } = require('./codegen-util');
55

components/_theme.scss

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,43 @@
1-
$screen-1: 320px;
2-
$screen-2: 800px; //SVGA
3-
$screen-3: 1280px; //HD +FHD/QHD
4-
$screen-4: 2048px; //2K +4K
1+
$screen-1: 320px; // mobile-portrait
2+
$screen-2: 480px; // mobile-landscape
3+
$screen-3: 768px; // tablet-portrait
4+
$screen-4: 1024px; // pc & tablet-landscape
5+
$screen-5: 2048px; // pc-wide
56

67
// Media queries
8+
// Wearable devices
79
@mixin mobile-xs {
8-
@media only screen and (max-width: #{$screen-1}) {
10+
@media only screen and (width < $screen-1) {
911
@content;
1012
}
1113
}
1214

13-
// "Mobile screen" is the base of css stylesheet
15+
// "Mobile portrait" is default
16+
// $screen-1 <= width < $screen-2
1417

18+
// Mobile-landscape
19+
@mixin mobile-wide {
20+
@media only screen and ($screen-2 <= width) {
21+
@content;
22+
}
23+
}
24+
25+
// Tablet-portrait
1526
@mixin tablet {
16-
@media only screen and (min-width: #{$screen-2}) {
27+
@media only screen and ($screen-3 <= width) {
1728
@content;
1829
}
1930
}
2031

32+
// PC & Tablet-landscape
2133
@mixin pc {
22-
@media only screen and (min-width: #{$screen-3}) {
34+
@media only screen and ($screen-4 <= width) {
2335
@content;
2436
}
2537
}
2638

27-
@mixin pc-xl {
28-
@media only screen and (min-width: #{$screen-4}) {
39+
@mixin pc-wide {
40+
@media only screen and ($screen-5 <= width) {
2941
@content;
3042
}
3143
}

components/errors/errorsStates.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { atom } from 'recoil';
1+
import { atom } from 'jotai';
22

3-
export const code = atom({ key: 'error-code', default: 500 });
3+
export const code = atom(500);

components/errors/errorsViewImage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
import { useAtomValue } from 'jotai';
12
import Image from 'next/image';
23
import Link from 'next/link';
3-
import { useRecoilValue } from 'recoil';
44
import imageSrc404 from '../../public/assets/images/404_broken_robot.png';
55
import imageSrc500 from '../../public/assets/images/500_faulty_dog.png';
66
import styles from './errors.module.scss';
77
import { code } from './errorsStates';
88

99
const View = () => {
10-
const errorCode = useRecoilValue(code);
10+
const errorCode = useAtomValue(code);
1111

1212
return (
1313
<div className={styles.errorImage}>

components/example/examplePresenter.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { placeholderUrl } from '../../controllers/apiURLs';
2-
import { staticQuery } from '../../controllers/net/staticQuery';
2+
import { useStaticQuery } from '../../controllers/net/staticQuery';
33
import styles from './example.module.scss';
44
import { ExamplePost } from './exampleType';
55
import Posts from './exampleViewPosts';
66

77
const Presenter = () => {
8-
const query = staticQuery<ExamplePost[]>(placeholderUrl);
8+
const query = useStaticQuery<ExamplePost[]>(placeholderUrl);
99

1010
let contents;
1111
switch (query.status) {

components/meta/gtm.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/ban-ts-comment */
12
// @ts-nocheck
23
import { useEffect } from 'react';
34

controllers/net/staticQuery.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useQuery, UseQueryResult } from '@tanstack/react-query';
22

3-
export const staticQuery = <T = unknown>(url: string) => {
3+
export const useStaticQuery = <T = unknown>(url: string) => {
44
return useQuery<T, Error, T, string[]>({
55
queryKey: ['static', url],
66
queryFn: async ({ queryKey }) => {

0 commit comments

Comments
 (0)