This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ref: https://www.swyx.io/css-100-bytes/ | |
html { | |
max-width: 38rem; | |
padding: 2rem; | |
margin: auto; | |
line-height: 1.5rem; | |
font-size: 24px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// pages/posts/[slug].tsx | |
import Head from "next/head"; | |
import Link from "next/link"; | |
import styles from "../../styles/Post.module.scss"; | |
import { GetStaticProps, GetStaticPaths } from "next"; | |
const Post = ({ post }) => { | |
// console.log(post); | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ref: https://github.com/twbs/stylelint-config-twbs-bootstrap/blob/main/css/index.js | |
'order/properties-order': [ | |
'position', | |
'top', | |
'right', | |
'bottom', | |
'left', | |
'z-index', | |
'box-sizing', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ========================================== | |
// RECESS | |
// RULE: Must use correct property ordering | |
// ========================================== | |
// Copyright 2012 Twitter, Inc | |
// Licensed under the Apache License v2.0 | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// ========================================== | |
// (ref: https://github.com/twitter/recess/blob/8a4835299518a57c71fb11cb7dc87cd1577a9872/lib/lint/strict-property-order.js) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// redux store로부터 불러온 card data | |
const { cards } = this.props; | |
{cards.map((card, idx) => { | |
<Formik | |
key={card.id} | |
initialValues={{ | |
id: card.id, | |
cardtype: card.cardtype, | |
question: card.question, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ADD_CARD, SHOW_CARD } from "../actions/cardActions.js"; | |
const reducer = (state = initialState, action) => { | |
switch (action.type) { | |
case SHOW_CARD: | |
return Object.assign({}, state, { cards: action.cards }); | |
// ... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from "axios"; | |
export const SHOW_CARD = "SHOW_CARD"; | |
// 서버로부터 카드 데이터 가져오기 | |
export function getDeckCards() { | |
return dispatch => { | |
axios | |
.get("http://localhost:4000/card/cardInfo") | |
.then(res => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Card from "../components/Card"; | |
import { connect } from "react-redux"; | |
// 컴포넌트에서 필요한 데이터를 store에서 추출하여 객체 반환 | |
function mapStateToProps(state) { | |
return { | |
cards: state.card.cards, | |
decks: state.deck.decks, | |
category: state.deck.category, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Formik props | |
const initialValues = { | |
decks: [""], // --- 1️⃣ | |
}; | |
const onSubmit = (values, actions) => { | |
registerDeck(values.decks); | |
getDeck(); | |
// 입력창 초기화 | |
actions.resetForm({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Header.js | |
import React from "react"; | |
import { Link, withRouter } from "react-router-dom"; | |
import "../styles/header.css"; | |
import NavBar from "./NavBar"; | |
function Header(props) { | |
console.log(props); |
NewerOlder