Skip to content

Instantly share code, notes, and snippets.

View WDever's full-sized avatar
⚛️
⚛️

Minoah WDever

⚛️
⚛️
View GitHub Profile
// style.tsx
import styled from 'styled-components';
import { Link } from 'gatsby';
import { pxToRem } from 'utils';
interface HeaderProps {
scrolled: boolean;
visibility: boolean;
}
// action.types.ts
export enum EditorTypes {
SET_BLOCK_TEXT = 'SET_BLOCK_TEXT',
SET_BLOCK_TYPE = 'SET_BLOCK_TYPE',
SET_CURRENT_BLOCK = 'SET_CURRENT_BLOCK',
ADD_BLOCK = 'ADD_BLOCK',
DELETE_BLOCK = 'DELETE_BLOCK',
<Switch>
<Route exact={true} path="/modal" render={() => <div>asdfasdf</div>} />
<Route
exact={true}
path="/modal/music"
render={() => <div>asdfasdfasdf</div>}
/>
<Redirect to="/error" />
</Switch>
declare global {
interface Window {
android: any;
}
}
window.android = {
logout: () => console.log('logout'),
};
MealList.forEach((item, i, org) => {
if (item.length < 5) {
const InsertArr = Array(5 - item.length).fill(
<MealItemComponent
key={i}
type="detail"
item={'급식정보가\n없습니다'}
date={''}
today={false}
day={''}
const board =
draft.board[
draft.board.findIndex(board => board.pk === action.meta.board_pk)
];
Object.assign(
board.comment[
board.comment.findIndex(comment => comment.pk === action.payload.pk)
],
action.payload,
);
import * as React from 'react';
const { useRef, useCallback } = React;
export function useLocalVar<T>(defaultValues: T) {
const state = useRef<T>(defaultValues);
const setState = useCallback(async (value: T) => {
state.current = value;
}, []);
import * as React from 'react';
const { useState, useEffect } = React;
interface initialFuncProps {
appId: string;
csrf: string;
version: string;
debug?: boolean;
display?: 'popup' | 'modal';
import * as React from 'react';
const { useState, useEffect } = React;
interface initialFuncProps {
appId: string;
csrf: string;
version: string;
debug?: boolean;
display?: 'popup' | 'modal';
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'react-app',
'plugin:prettier/recommended',
'prettier',
'airbnb',
],