Skip to content

Instantly share code, notes, and snippets.

@u88803494
u88803494 / action.js
Created March 7, 2020 12:19
redux-thunk
import * as actionTypes from './actionTypes';
import * as WebAPI from './WebAPI';
export const updateNavText = (text) => {
return {
type: actionTypes.UPDATE_NAV_TEXT,
value: text,
};
};
@u88803494
u88803494 / editing_window\EditingWindow.css
Last active February 20, 2020 14:50
串 API 跟同步畫面,還有實作偵測功能
.form__datatype {
display: flex;
justify-content: space-between;
}
.form__empty {
color: red;
}
.form__empty--submit {
@u88803494
u88803494 / EditingWindow.js
Last active February 9, 2020 14:44
編輯視窗的介面
import React, { useState } from 'react';
import { Button, Modal, Form } from 'react-bootstrap';
const EditingWindow = ({ onHide, show, post, status }) => {
const newPost = { title: '', author: '', body: '', }
const [thisPost, setThisPost] = useState(post ? post : newPost)
const changePost = (e) => {
setThisPost({
...thisPost,
@u88803494
u88803494 / EditingWindow.js
Last active February 3, 2020 10:21
彈出視窗的按鈕跟內建的方法
import React from 'react';
import './editingWindow.css';
import { Button, Modal } from 'react-bootstrap';
const EditingWindow = ({ onHide, show, state }) => (
<Modal
size="lg"
aria-labelledby="contained-modal-title-vcenter"
centered
{...{ onHide, show }}
@u88803494
u88803494 / Nav.js
Created February 3, 2020 09:36
React 隱藏導覽列的 code
import React from 'react';
import { Nav, Navbar } from 'react-bootstrap';
import './nav.css';
class TheNavbar extends React.Component {
constructor(props) {
super(props)
this.state = {
positionY: window.pageYOffset,
movedY: 0,
@u88803494
u88803494 / App.css
Created January 7, 2020 15:20
w23 Redux 補充部分,很多邏輯打包,一樣用反斜線替代資料結構
.App {
text-align: center;
}
.page {
margin-top: 100px;
}
@u88803494
u88803494 / App.css
Last active January 3, 2020 11:37
w23 學習 redux 的 blog
.App {
text-align: center;
}
.page {
margin-top: 100px;
}
@u88803494
u88803494 / App.css
Created November 29, 2019 15:08
w22 的 blog 教學加上 router
.App {
text-align: center;
}
.page {
margin-top: 74px;
}
@u88803494
u88803494 / App.js
Created November 27, 2019 08:19
只含改變的部分
import React, { Component } from 'react';
import './App.css';
import Nav from './nav';
import About from './about';
import Home from './home';
import Post from './post';
const removeHashTag = str => {
return str.slice(1);
}
@u88803494
u88803494 / App.css
Created November 27, 2019 04:31
react app Blog 這邊有把檔案切得很開。然後再子資料夾底下的我用反斜線替代
.App {
text-align: center;
}
.page {
margin-top: 74px;
}