From 368c9ec03cd54947b6622430ee3e1aab2727d44f Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Fri, 12 Nov 2021 17:24:16 +0100 Subject: [PATCH] Add some style --- .gitignore | 2 ++ package.json | 4 ++++ src/App.css | 5 +++++ src/App.tsx | 12 +++++++++--- src/Ligne.tsx | 18 +++++++++++------- src/index.tsx | 1 + yarn.lock | 31 +++++++++++++++++++++++++++++++ 7 files changed, 63 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 4d29575..8b182cf 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +.env diff --git a/package.json b/package.json index ae4900f..3781004 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,9 @@ "version": "0.1.0", "private": true, "dependencies": { + "@fortawesome/fontawesome-svg-core": "^1.2.36", + "@fortawesome/free-solid-svg-icons": "^5.15.4", + "@fortawesome/react-fontawesome": "^0.1.16", "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", @@ -10,6 +13,7 @@ "@types/node": "^12.0.0", "@types/react": "^17.0.0", "@types/react-dom": "^17.0.0", + "bootstrap": "^5.1.3", "react": "^17.0.2", "react-dom": "^17.0.2", "react-scripts": "4.0.3", diff --git a/src/App.css b/src/App.css index fc78f13..fe6f2fd 100644 --- a/src/App.css +++ b/src/App.css @@ -1,3 +1,8 @@ +body { + font-size: 200%; + margin-top: 1em; +} + .placeholder:empty:before { content: "\200b"; } diff --git a/src/App.tsx b/src/App.tsx index 9f1761d..375510f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -19,9 +19,15 @@ class App extends React.Component<{}, IAppState> { } render() { - return
- {this.state.passages.map((ligne) => )} - + return
+
+ {this.state.passages.map((ligne) => )} +
+
+
+ +
+
; } diff --git a/src/Ligne.tsx b/src/Ligne.tsx index d525e99..ddc7723 100644 --- a/src/Ligne.tsx +++ b/src/Ligne.tsx @@ -1,11 +1,16 @@ import React from "react"; import {ILigne, PassageType} from "./interfaces"; +import {FontAwesomeIcon} from '@fortawesome/react-fontawesome' +import {faBus} from '@fortawesome/free-solid-svg-icons' + export default class Ligne extends React.Component { render() { - return
-

Prochains passages de la ligne {placeholder(this.props.ligne)} :

- + return
+
+
{placeholder(this.props.ligne)}
+ +
} } @@ -16,7 +21,7 @@ interface IPassagesProps { class Passages extends React.Component { render() { - return
    + return
      {this.props.passages?.map((passage, index) => )}
    } @@ -29,15 +34,14 @@ interface IPassageProps { class Passage extends React.Component { render() { - return
  • {placeholder(this.props.passage)}
  • + return
  • {placeholder(this.props.passage)}
  • } } function placeholder(value?: string) { if (value === undefined) { return - } - else { + } else { return value; } } diff --git a/src/index.tsx b/src/index.tsx index ef2edf8..7997c85 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,3 +1,4 @@ +import 'bootstrap/dist/css/bootstrap.css'; import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; diff --git a/yarn.lock b/yarn.lock index c868ae4..624f0de 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1242,6 +1242,32 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" +"@fortawesome/fontawesome-common-types@^0.2.36": + version "0.2.36" + resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.36.tgz#b44e52db3b6b20523e0c57ef8c42d315532cb903" + integrity sha512-a/7BiSgobHAgBWeN7N0w+lAhInrGxksn13uK7231n2m8EDPE3BMCl9NZLTGrj9ZXfCmC6LM0QLqXidIizVQ6yg== + +"@fortawesome/fontawesome-svg-core@^1.2.36": + version "1.2.36" + resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.36.tgz#4f2ea6f778298e0c47c6524ce2e7fd58eb6930e3" + integrity sha512-YUcsLQKYb6DmaJjIHdDWpBIGCcyE/W+p/LMGvjQem55Mm2XWVAP5kWTMKWLv9lwpCVjpLxPyOMOyUocP1GxrtA== + dependencies: + "@fortawesome/fontawesome-common-types" "^0.2.36" + +"@fortawesome/free-solid-svg-icons@^5.15.4": + version "5.15.4" + resolved "https://registry.yarnpkg.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.15.4.tgz#2a68f3fc3ddda12e52645654142b9e4e8fbb6cc5" + integrity sha512-JLmQfz6tdtwxoihXLg6lT78BorrFyCf59SAwBM6qV/0zXyVeDygJVb3fk+j5Qat+Yvcxp1buLTY5iDh1ZSAQ8w== + dependencies: + "@fortawesome/fontawesome-common-types" "^0.2.36" + +"@fortawesome/react-fontawesome@^0.1.16": + version "0.1.16" + resolved "https://registry.yarnpkg.com/@fortawesome/react-fontawesome/-/react-fontawesome-0.1.16.tgz#ce7665490214e20f929368d6b65f68884a99276a" + integrity sha512-aLmzDwC9rEOAJv2UJdMns89VZR5Ry4IHu5dQQh24Z/lWKEm44lfQr1UNalZlkUaQN8d155tNh+CS7ntntj1VMA== + dependencies: + prop-types "^15.7.2" + "@gar/promisify@^1.0.1": version "1.1.2" resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.2.tgz#30aa825f11d438671d585bd44e7fd564535fc210" @@ -2960,6 +2986,11 @@ boolbase@^1.0.0, boolbase@~1.0.0: resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= +bootstrap@^5.1.3: + version "5.1.3" + resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-5.1.3.tgz#ba081b0c130f810fa70900acbc1c6d3c28fa8f34" + integrity sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q== + boxen@5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50"