From 4b0492a81a105b2df124f65bf53ef23c2493e74c Mon Sep 17 00:00:00 2001 From: Ken Date: Fri, 15 Feb 2019 16:15:27 -0800 Subject: [PATCH] adding a raised background --- index.html | 20 +++++++++++++-- step2-02/src/components/TodoHeader.tsx | 4 +-- step2-03/src/components/TodoApp.tsx | 22 +++++++++++------ step2-03/src/components/TodoHeader.tsx | 8 +++--- step2-03/src/components/TodoListItem.tsx | 6 ++--- webpack.config.js | 31 +++++++++++++++++------- 6 files changed, 64 insertions(+), 27 deletions(-) diff --git a/index.html b/index.html index 7a5a48f..196de56 100644 --- a/index.html +++ b/index.html @@ -68,8 +68,24 @@

Day 2

Setup, HTML, CSS, Javascript and Intro to React -
  • Step 1
  • -
  • Step 2
  • +
  • + + Step 1
    + Typescript Basics +
    +
  • +
  • + + Step 2
    + UI Fabric +
    +
  • +
  • + + Step 3
    + UI Fabric: Theming and Styling +
    +
  • diff --git a/step2-02/src/components/TodoHeader.tsx b/step2-02/src/components/TodoHeader.tsx index 0f91255..dec977f 100644 --- a/step2-02/src/components/TodoHeader.tsx +++ b/step2-02/src/components/TodoHeader.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Text } from '@uifabric/experiments'; import { Stack } from 'office-ui-fabric-react'; -import { Pivot, PivotItem, TextField, DefaultButton } from 'office-ui-fabric-react'; +import { Pivot, PivotItem, TextField, PrimaryButton } from 'office-ui-fabric-react'; import { FilterTypes } from '../store'; interface TodoHeaderProps { @@ -31,7 +31,7 @@ export class TodoHeader extends React.Component - Add + Add diff --git a/step2-03/src/components/TodoApp.tsx b/step2-03/src/components/TodoApp.tsx index c6d13de..6a05102 100644 --- a/step2-03/src/components/TodoApp.tsx +++ b/step2-03/src/components/TodoApp.tsx @@ -1,12 +1,18 @@ import React from 'react'; -import { Stack } from 'office-ui-fabric-react'; +import { Stack, Customizer, mergeStyles, getTheme } from 'office-ui-fabric-react'; import { TodoFooter } from './TodoFooter'; import { TodoHeader } from './TodoHeader'; import { TodoList } from './TodoList'; import { Store } from '../store'; +import { FluentCustomizations } from '@uifabric/fluent-theme'; let index = 0; +const className = mergeStyles({ + padding: 25, + ...getTheme().effects.elevation4 +}); + export class TodoApp extends React.Component { constructor(props) { super(props); @@ -18,13 +24,15 @@ export class TodoApp extends React.Component { render() { const { filter, todos } = this.state; return ( - - - - - + + + + + + + - + ); } diff --git a/step2-03/src/components/TodoHeader.tsx b/step2-03/src/components/TodoHeader.tsx index 0f91255..0015717 100644 --- a/step2-03/src/components/TodoHeader.tsx +++ b/step2-03/src/components/TodoHeader.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Text } from '@uifabric/experiments'; import { Stack } from 'office-ui-fabric-react'; -import { Pivot, PivotItem, TextField, DefaultButton } from 'office-ui-fabric-react'; +import { Pivot, PivotItem, TextField, PrimaryButton } from 'office-ui-fabric-react'; import { FilterTypes } from '../store'; interface TodoHeaderProps { @@ -22,16 +22,16 @@ export class TodoHeader extends React.Component + todos - + - Add + Add diff --git a/step2-03/src/components/TodoListItem.tsx b/step2-03/src/components/TodoListItem.tsx index 9491028..030aa73 100644 --- a/step2-03/src/components/TodoListItem.tsx +++ b/step2-03/src/components/TodoListItem.tsx @@ -31,15 +31,15 @@ export class TodoListItem extends React.Component complete(id)} />
    - - remove(id)} /> + + remove(id)} />
    )} {this.state.editing && ( - + diff --git a/webpack.config.js b/webpack.config.js index f839b83..54cf914 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,18 +1,31 @@ // @ts-check const path = require('path'); +const fs = require('fs'); + const HtmlWebpackPlugin = require('html-webpack-plugin'); const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); -const entries = { - 'step1-04': './step1-04/src/index', - 'step1-05': './step1-05/src/index', - 'step1-06': './step1-06/src/index', - 'step1-07': './step1-07/src/index', - 'step2-01': './step2-01/src/index', - 'step2-02': './step2-02/src/index', - playground: './playground/src/index' -}; +const entries = {}; + +function getEntryPoint(entry) { + if (entry.includes('step') || entry.includes('playground')) { + for (let suffix of ['.js', '.jsx', '.ts', '.tsx']) { + if (fs.existsSync(`./${entry}/src/index${suffix}`)) { + return `./${entry}/src/index${suffix}`; + } + } + } + return false; +} + +fs.readdirSync('./').filter(entry => { + const entryPoint = getEntryPoint(entry); + + if (entryPoint) { + entries[entry] = entryPoint; + } +}); module.exports = function() { return {