From 0c96d65350e63683d2e88cd0df4abbee5c92314d Mon Sep 17 00:00:00 2001 From: Toni Fisler Date: Wed, 14 Mar 2018 18:21:44 +0100 Subject: [PATCH] setup a page with all icons --- src/components/App/App.js | 2 + src/components/IconsTable/IconsTable.scss | 1 + src/components/Sidebar/Sidebar.js | 3 ++ src/views/Icons/Icons.js | 46 +++++++++++++++++++++++ src/views/Icons/Icons.scss | 31 +++++++++++++++ 5 files changed, 83 insertions(+) create mode 100644 src/components/IconsTable/IconsTable.scss create mode 100644 src/views/Icons/Icons.js create mode 100644 src/views/Icons/Icons.scss diff --git a/src/components/App/App.js b/src/components/App/App.js index 0606bd1..4408ee0 100644 --- a/src/components/App/App.js +++ b/src/components/App/App.js @@ -16,6 +16,7 @@ import SingleFull from '../../views/Single/SingleFull'; import SinglePage from '../../views/Single/SinglePage'; import Doc from '../../views/Doc/Doc'; import Colors from '../../views/Colors/Colors'; +import Icons from '../../views/Icons/Icons'; import './App.css'; @@ -79,6 +80,7 @@ class App extends Component { + diff --git a/src/components/IconsTable/IconsTable.scss b/src/components/IconsTable/IconsTable.scss new file mode 100644 index 0000000..ea37b29 --- /dev/null +++ b/src/components/IconsTable/IconsTable.scss @@ -0,0 +1 @@ +@import '../../variables.scss'; diff --git a/src/components/Sidebar/Sidebar.js b/src/components/Sidebar/Sidebar.js index f68d221..f5a6092 100644 --- a/src/components/Sidebar/Sidebar.js +++ b/src/components/Sidebar/Sidebar.js @@ -28,6 +28,9 @@ const Sidebar = (props) => {
  • Colors
  • +
  • + Icons +
  • diff --git a/src/views/Icons/Icons.js b/src/views/Icons/Icons.js new file mode 100644 index 0000000..18a1a45 --- /dev/null +++ b/src/views/Icons/Icons.js @@ -0,0 +1,46 @@ +import React, { Component } from 'react'; + +import './Icons.css'; +import {SET_COMPONENT_MARKUP} from '../../actions/atomic'; + +class Icons extends Component { + constructor() { + super(); + + this.state = { + icons: window.icons, + }; + } + + renderIconsTable() { + const icons = this.state.icons; + + return ( +
    + {Object.keys(icons).map((key) => { + const icon = icons[key]; + + return ( +
    + + {icon} +
    + ); + })} +
    + ); + } + + render() { + return ( +
    +

    Icons

    +
    + {this.state.icons ? this.renderIconsTable() : 'No icons to display'} +
    +
    + ); + } +} + +export default Icons; diff --git a/src/views/Icons/Icons.scss b/src/views/Icons/Icons.scss new file mode 100644 index 0000000..4417f74 --- /dev/null +++ b/src/views/Icons/Icons.scss @@ -0,0 +1,31 @@ +@import '../../variables.scss'; + +.tlbx-grid { + display: grid; + grid-gap: 1px; + grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); +} + +.tlbx-icon { + width: 30px; + height: 30px; + margin-bottom: 10px; + + svg { + width: 30px; + height: 30px; + } +} + +.tlbx-icon-wrapper { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + padding: 15px 30px; + background-color: $white; + + &:hover { + background-color: white; + } +}