From 97f44837d67336b30c009c7f80a1b1cc34746775 Mon Sep 17 00:00:00 2001 From: Doug McDonald Date: Sun, 15 Mar 2020 10:17:30 +0000 Subject: [PATCH 01/10] Complete removal of styled components from home / landing page --- .../src/features/common/featureButton.js | 32 ++------ .../src/features/common/primaryButton.js | 7 ++ .../src/features/onboarding/guidance.js | 7 ++ .../src/features/onboarding/home.js | 80 ++++--------------- .../src/features/onboarding/speechBubble.js | 7 ++ packages/corewar-ui/src/styles/index.css | 5 ++ packages/corewar-ui/src/styles/tailwind.css | 66 +++++++++++++++ packages/corewar-ui/tailwind.config.js | 5 ++ 8 files changed, 118 insertions(+), 91 deletions(-) create mode 100644 packages/corewar-ui/src/features/common/primaryButton.js create mode 100644 packages/corewar-ui/src/features/onboarding/guidance.js create mode 100644 packages/corewar-ui/src/features/onboarding/speechBubble.js diff --git a/packages/corewar-ui/src/features/common/featureButton.js b/packages/corewar-ui/src/features/common/featureButton.js index b0328853..71f50b15 100644 --- a/packages/corewar-ui/src/features/common/featureButton.js +++ b/packages/corewar-ui/src/features/common/featureButton.js @@ -1,27 +1,7 @@ -import styled from 'styled-components' +import React from 'react' -import { colour, space } from '../common/theme' - -const FeatureButton = styled.a` - border: 2px solid ${colour.white}; - border-radius: 5px; - margin: ${space.m}; - padding: ${space.m}; - background: none; - display: inline-block; - min-width: 200px; - color: ${colour.lightgrey}; - font-weight: 300; - text-align: center; - text-decoration: none; - transition: 0.2s; - - :hover { - background-color: ${colour.lightbg}; - color: ${colour.white}; - cursor: pointer; - transition: 0.2s; - } -` - -export default FeatureButton +export default ({ children }) => ( + +) diff --git a/packages/corewar-ui/src/features/common/primaryButton.js b/packages/corewar-ui/src/features/common/primaryButton.js new file mode 100644 index 00000000..d5aa6307 --- /dev/null +++ b/packages/corewar-ui/src/features/common/primaryButton.js @@ -0,0 +1,7 @@ +import React from 'react' + +export default ({ children }) => ( + +) diff --git a/packages/corewar-ui/src/features/onboarding/guidance.js b/packages/corewar-ui/src/features/onboarding/guidance.js new file mode 100644 index 00000000..b4644558 --- /dev/null +++ b/packages/corewar-ui/src/features/onboarding/guidance.js @@ -0,0 +1,7 @@ +import React from 'react' + +export default ({ children }) => ( +
+ {children} +
+) diff --git a/packages/corewar-ui/src/features/onboarding/home.js b/packages/corewar-ui/src/features/onboarding/home.js index 2eb59880..6f3dd009 100644 --- a/packages/corewar-ui/src/features/onboarding/home.js +++ b/packages/corewar-ui/src/features/onboarding/home.js @@ -1,14 +1,13 @@ import React from 'react' -import styled from 'styled-components' import Octicon from 'react-octicon' -import { colour, font, space } from '../common/theme' -import { media } from '../common/mediaQuery' - import SiteNav from '../common/siteNav' import HeroLogo from '../common/heroLogo' import FeatureButton from '../common/featureButton' +import PrimaryButton from '../common/primaryButton' import RoadmapItem from './roadmapItem' +import SpeechBubble from './speechBubble' +import Guidance from './guidance' import SimulatorImage from '../../img/corewarx200.gif' import ParserImage from '../../img/redcode.gif' @@ -63,60 +62,11 @@ const roadMapItems = [ } ] -const Feature = styled.div` - ${media.tablet`border-right: none;`}; - ${media.tablet`border-bottom: 1px solid ${colour.lightbg}; padding-bottom: ${space.l};`}; - - :hover { - cursor: pointer; - .guidance { - opacity: 1; - transition: 0.5s; - } - } -` - -const Guidance = styled.div.attrs({ - className: 'guidance' -})` - opacity: 0; - ${media.tablet`opacity: 1;`} - transition: 0.5s; - display: flex; - flex-direction: row; - align-items: center; - justify-content: flex-start; - margin: ${space.l}; - ${media.phone`margin: ${space.m};`} -` - -const SpeechBubble = styled.div` - border-radius: 10px; - background-color: ${colour.defaultbg}; - min-height: 200px; - margin-right: ${space.l}; - padding: ${space.m}; - line-height: 1.5em; - text-align: center; - color: ${colour.white}; - font-family: ${font.code}; - display: flex; - flex-direction: column; - justify-content: center; -` - -const PrimaryButton = FeatureButton.extend` - background: ${colour.white}; - color: ${colour.darkbg}; - transition: 0.2s; - font-weight: bold; -` - const Home = () => (
-
+
Play Now Learn more
@@ -156,35 +106,35 @@ const Home = () => (
-
+

Experienced player

I’ve played corewar before and understand the instructions and concepts

Play Now - +
- You should head over to the app and follow the interactive guide to explore the features + Head over to the app and follow the interactive guide to explore the features - -
-
+
+ +

New to the game

I’ve done some coding before but never played corewar

View Tutorial - +
- You should run through the tutorial to understand the basics of corewar first, then head - over the app to test what you've learned. + Run through the tutorial to understand the basics of corewar first, then head over the + app to test what you've learned. - -
+ +
( +
+ {children} +
+) diff --git a/packages/corewar-ui/src/styles/index.css b/packages/corewar-ui/src/styles/index.css index 7f393742..1d8a2f31 100644 --- a/packages/corewar-ui/src/styles/index.css +++ b/packages/corewar-ui/src/styles/index.css @@ -3,3 +3,8 @@ @tailwind components; @tailwind utilities; + +.guidance:hover > section { + opacity: 1; + transition: 0.5s; +} diff --git a/packages/corewar-ui/src/styles/tailwind.css b/packages/corewar-ui/src/styles/tailwind.css index cfc4fa96..fd398a0d 100644 --- a/packages/corewar-ui/src/styles/tailwind.css +++ b/packages/corewar-ui/src/styles/tailwind.css @@ -5331,6 +5331,18 @@ video { min-width: 0; } +.min-w-150 { + min-width: 150px; +} + +.min-w-200 { + min-width: 200px; +} + +.min-w-300 { + min-width: 300px; +} + .min-w-full { min-width: 100%; } @@ -12728,6 +12740,12 @@ video { transition-duration: 1000ms; } +.guidance:hover > section { + opacity: 1; + -webkit-transition: 0.5s; + transition: 0.5s; +} + @media (min-width: 640px) { .sm\:sr-only { position: absolute; @@ -17445,6 +17463,18 @@ video { min-width: 0; } + .sm\:min-w-150 { + min-width: 150px; + } + + .sm\:min-w-200 { + min-width: 200px; + } + + .sm\:min-w-300 { + min-width: 300px; + } + .sm\:min-w-full { min-width: 100%; } @@ -29560,6 +29590,18 @@ video { min-width: 0; } + .md\:min-w-150 { + min-width: 150px; + } + + .md\:min-w-200 { + min-width: 200px; + } + + .md\:min-w-300 { + min-width: 300px; + } + .md\:min-w-full { min-width: 100%; } @@ -41675,6 +41717,18 @@ video { min-width: 0; } + .lg\:min-w-150 { + min-width: 150px; + } + + .lg\:min-w-200 { + min-width: 200px; + } + + .lg\:min-w-300 { + min-width: 300px; + } + .lg\:min-w-full { min-width: 100%; } @@ -53790,6 +53844,18 @@ video { min-width: 0; } + .xl\:min-w-150 { + min-width: 150px; + } + + .xl\:min-w-200 { + min-width: 200px; + } + + .xl\:min-w-300 { + min-width: 300px; + } + .xl\:min-w-full { min-width: 100%; } diff --git a/packages/corewar-ui/tailwind.config.js b/packages/corewar-ui/tailwind.config.js index f6a590fb..d47600ef 100644 --- a/packages/corewar-ui/tailwind.config.js +++ b/packages/corewar-ui/tailwind.config.js @@ -33,6 +33,11 @@ module.exports = { '200': '200px', '300': '300px' }, + minWidth: { + '150': '150px', + '200': '200px', + '300': '300px' + }, maxWidth: { '350': '350px' }, From 9f96a83a2cf445a110521da6c1de278cb32f1e94 Mon Sep 17 00:00:00 2001 From: Doug McDonald Date: Sun, 15 Mar 2020 10:29:58 +0000 Subject: [PATCH 02/10] debatable margin tweaks --- .../src/features/common/heroLogo.js | 2 +- .../src/features/onboarding/home.js | 12 +++++------ packages/corewar-ui/src/styles/tailwind.css | 20 +++++++++++++++++++ packages/corewar-ui/tailwind.config.js | 1 + 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/packages/corewar-ui/src/features/common/heroLogo.js b/packages/corewar-ui/src/features/common/heroLogo.js index 29ba3241..12022d3a 100644 --- a/packages/corewar-ui/src/features/common/heroLogo.js +++ b/packages/corewar-ui/src/features/common/heroLogo.js @@ -26,7 +26,7 @@ const HeroLogo = () => (
{features.map(feature => ( - +

{feature.heading}

diff --git a/packages/corewar-ui/src/features/onboarding/home.js b/packages/corewar-ui/src/features/onboarding/home.js index 6f3dd009..d9697f75 100644 --- a/packages/corewar-ui/src/features/onboarding/home.js +++ b/packages/corewar-ui/src/features/onboarding/home.js @@ -63,7 +63,7 @@ const roadMapItems = [ ] const Home = () => ( -
+
@@ -71,14 +71,14 @@ const Home = () => ( Learn more
-

+

This is Corewar where players test their coding skills against each other, writing warriors which battle for control of the core. Do you have what it takes to become the King of the Hill?

-
+
Our interactive Corewar Simulator provides the battle ground for your warriors. Play the game, inspect the core and debug your code from your web browser!
@@ -98,7 +98,7 @@ const Home = () => ( alt={`Animated parser usage example`} />
-
+
Our powerful Redcode editor makes it easy to write warriors and through real-time code analysis improve the quality of your programs. The perfect canvas on which to craft your masterpiece. @@ -148,7 +148,7 @@ const Home = () => ( {roadMapItems .filter(x => x.complete) .map(item => ( - + ))}
@@ -158,7 +158,7 @@ const Home = () => ( {roadMapItems .filter(x => x.complete === false) .map(item => ( - + ))}
diff --git a/packages/corewar-ui/src/styles/tailwind.css b/packages/corewar-ui/src/styles/tailwind.css index fd398a0d..85d3c321 100644 --- a/packages/corewar-ui/src/styles/tailwind.css +++ b/packages/corewar-ui/src/styles/tailwind.css @@ -10853,6 +10853,10 @@ video { grid-template-rows: none; } +.grid-rows-mobile-home-grid { + grid-template-rows: 48px 25vh repeat(8, auto) 100px; +} + .grid-rows-home-grid { grid-template-rows: 48px 50vh repeat(8, auto) 100px; } @@ -22985,6 +22989,10 @@ video { grid-template-rows: none; } + .sm\:grid-rows-mobile-home-grid { + grid-template-rows: 48px 25vh repeat(8, auto) 100px; + } + .sm\:grid-rows-home-grid { grid-template-rows: 48px 50vh repeat(8, auto) 100px; } @@ -35112,6 +35120,10 @@ video { grid-template-rows: none; } + .md\:grid-rows-mobile-home-grid { + grid-template-rows: 48px 25vh repeat(8, auto) 100px; + } + .md\:grid-rows-home-grid { grid-template-rows: 48px 50vh repeat(8, auto) 100px; } @@ -47239,6 +47251,10 @@ video { grid-template-rows: none; } + .lg\:grid-rows-mobile-home-grid { + grid-template-rows: 48px 25vh repeat(8, auto) 100px; + } + .lg\:grid-rows-home-grid { grid-template-rows: 48px 50vh repeat(8, auto) 100px; } @@ -59366,6 +59382,10 @@ video { grid-template-rows: none; } + .xl\:grid-rows-mobile-home-grid { + grid-template-rows: 48px 25vh repeat(8, auto) 100px; + } + .xl\:grid-rows-home-grid { grid-template-rows: 48px 50vh repeat(8, auto) 100px; } diff --git a/packages/corewar-ui/tailwind.config.js b/packages/corewar-ui/tailwind.config.js index d47600ef..ca205947 100644 --- a/packages/corewar-ui/tailwind.config.js +++ b/packages/corewar-ui/tailwind.config.js @@ -22,6 +22,7 @@ module.exports = { success: '#6FCF97' }, gridTemplateRows: { + 'mobile-home-grid': '48px 25vh repeat(8, auto) 100px', 'home-grid': '48px 50vh repeat(8, auto) 100px', roadmap: '80px 1fr' }, From b43ad7da985ec27a7212f20c2f285ac042cf514d Mon Sep 17 00:00:00 2001 From: Doug McDonald Date: Sun, 15 Mar 2020 10:42:33 +0000 Subject: [PATCH 03/10] Bit of component extraction --- .../src/features/onboarding/feature.js | 9 +++++ .../features/onboarding/featureDescription.js | 7 ++++ .../src/features/onboarding/guidanceText.js | 11 +++++ .../src/features/onboarding/home.js | 40 +++++++++---------- packages/corewar-ui/src/styles/index.css | 4 +- 5 files changed, 47 insertions(+), 24 deletions(-) create mode 100644 packages/corewar-ui/src/features/onboarding/feature.js create mode 100644 packages/corewar-ui/src/features/onboarding/featureDescription.js create mode 100644 packages/corewar-ui/src/features/onboarding/guidanceText.js diff --git a/packages/corewar-ui/src/features/onboarding/feature.js b/packages/corewar-ui/src/features/onboarding/feature.js new file mode 100644 index 00000000..abe28b1c --- /dev/null +++ b/packages/corewar-ui/src/features/onboarding/feature.js @@ -0,0 +1,9 @@ +import React from 'react' + +export default ({ children, className }) => ( +
+ {children} +
+) diff --git a/packages/corewar-ui/src/features/onboarding/featureDescription.js b/packages/corewar-ui/src/features/onboarding/featureDescription.js new file mode 100644 index 00000000..4077d6d4 --- /dev/null +++ b/packages/corewar-ui/src/features/onboarding/featureDescription.js @@ -0,0 +1,7 @@ +import React from 'react' + +export default ({ children }) => ( +

+ {children} +

+) diff --git a/packages/corewar-ui/src/features/onboarding/guidanceText.js b/packages/corewar-ui/src/features/onboarding/guidanceText.js new file mode 100644 index 00000000..b23cdd83 --- /dev/null +++ b/packages/corewar-ui/src/features/onboarding/guidanceText.js @@ -0,0 +1,11 @@ +import React from 'react' +import Octicon from 'react-octicon' + +import SpeechBubble from './speechBubble' + +export default ({ children }) => ( +
+ + {children} +
+) diff --git a/packages/corewar-ui/src/features/onboarding/home.js b/packages/corewar-ui/src/features/onboarding/home.js index d9697f75..3d3da9bd 100644 --- a/packages/corewar-ui/src/features/onboarding/home.js +++ b/packages/corewar-ui/src/features/onboarding/home.js @@ -6,8 +6,10 @@ import HeroLogo from '../common/heroLogo' import FeatureButton from '../common/featureButton' import PrimaryButton from '../common/primaryButton' import RoadmapItem from './roadmapItem' -import SpeechBubble from './speechBubble' import Guidance from './guidance' +import GuidanceText from './guidanceText' +import Feature from './feature' +import FeatureDescription from './featureDescription' import SimulatorImage from '../../img/corewarx200.gif' import ParserImage from '../../img/redcode.gif' @@ -77,11 +79,11 @@ const Home = () => ( Hill?
-
-
+ + Our interactive Corewar Simulator provides the battle ground for your warriors. Play the game, inspect the core and debug your code from your web browser! -
+
( alt={`Animated core simulator example`} />
-
-
+ +
( alt={`Animated parser usage example`} />
-
+ Our powerful Redcode editor makes it easy to write warriors and through real-time code analysis improve the quality of your programs. The perfect canvas on which to craft your masterpiece. -
-
+ +
@@ -113,12 +115,9 @@ const Home = () => ( I’ve played corewar before and understand the instructions and concepts

Play Now -
- - - Head over to the app and follow the interactive guide to explore the features - -
+ + Head over to the app and follow the interactive guide to explore the features +
@@ -127,13 +126,10 @@ const Home = () => ( I’ve done some coding before but never played corewar

View Tutorial -
- - - Run through the tutorial to understand the basics of corewar first, then head over the - app to test what you've learned. - -
+ + Run through the tutorial to understand the basics of corewar first, then head over the app + to test what you've learned. +
diff --git a/packages/corewar-ui/src/styles/index.css b/packages/corewar-ui/src/styles/index.css index 1d8a2f31..dd304dd2 100644 --- a/packages/corewar-ui/src/styles/index.css +++ b/packages/corewar-ui/src/styles/index.css @@ -2,9 +2,9 @@ @tailwind components; -@tailwind utilities; - .guidance:hover > section { opacity: 1; transition: 0.5s; } + +@tailwind utilities; From 4ed34a01e1fa1dc6ce1d62587da6f367cdadda5b Mon Sep 17 00:00:00 2001 From: Doug McDonald Date: Sun, 15 Mar 2020 11:07:09 +0000 Subject: [PATCH 04/10] rework with a proper mobile nav --- .../corewar-ui/src/features/common/siteNav.js | 109 ++++++++++-------- .../corewar-ui/src/features/topbar/logo.js | 6 +- .../src/features/topbar/siteHeader.js | 2 +- packages/corewar-ui/src/styles/tailwind.css | 32 ++--- packages/corewar-ui/tailwind.config.js | 4 +- 5 files changed, 82 insertions(+), 71 deletions(-) diff --git a/packages/corewar-ui/src/features/common/siteNav.js b/packages/corewar-ui/src/features/common/siteNav.js index 9d3fb957..681cf7dd 100644 --- a/packages/corewar-ui/src/features/common/siteNav.js +++ b/packages/corewar-ui/src/features/common/siteNav.js @@ -1,56 +1,67 @@ -import React from 'react' -import styled from 'styled-components' +import React, { useState } from 'react' -import { colour, space } from '../common/theme' -import { media } from '../common/mediaQuery' +import Logo from '../topbar/logo' -const Header = styled.header` - display: flex; - flex-direction: row-reverse; - margin: 0 ${space.xl}; - ${media.phone`margin: 0;`} - - a { - color: ${colour.grey}; - padding-bottom: ${space.s}; - margin: 0 ${space.s}; - ${media.phone`margin: 0;`} - display: inline-block; - min-width: 80px; - text-decoration: none; - font-weight: 400; - text-align: center; - border-bottom: 2px solid transparent; - transition: 0.5s; - } +const Link = ({ route, children }) => ( + + {children} + +) - a:hover { - border-bottom: 2px solid ${colour.blue}; - colour: ${colour.white}; - transition: 0.5s; - } -` +const MobileLink = ({ route, children }) => ( + + {children} + +) -const Nav = styled.nav` - display: flex; - flex-direction: row; - justify-content: flex-end; - ${media.phone`justify-content: center;`} - align-items: center; - width: 100%; -` +const links = [ + { route: `/app/editor/src`, text: `play` }, + { route: `/learn`, text: `learn` }, + { route: `/#features`, text: `features` }, + { route: `/sign-up`, text: `sign up` }, + { route: `/contact-us`, text: `contact us` }, + { route: `https://github.com/corewar/corewar.io`, text: `code` } +] -const SiteNav = () => ( -
- -
-) +const SiteNav = () => { + const [isExpanded, toggleExpansion] = useState(false) + return ( +
+
+ + + + +
+
+ ) +} export default SiteNav diff --git a/packages/corewar-ui/src/features/topbar/logo.js b/packages/corewar-ui/src/features/topbar/logo.js index 955d0ec3..93b1960e 100644 --- a/packages/corewar-ui/src/features/topbar/logo.js +++ b/packages/corewar-ui/src/features/topbar/logo.js @@ -6,7 +6,7 @@ import { colour, font, space } from '../common/theme' import CorewarLogo from '../../img/corewar-logo.png' -const Wrapper = styled.section` +const Wrapper = styled.a` display: grid; grid-template-columns: ${space.header} 1fr; ` @@ -38,8 +38,8 @@ const SiteDomain = styled.span` color: ${colour.white}; ` -const Logo = ({ siteName, siteDomain, history }) => ( - history.push(`/`)}> +const Logo = ({ siteName, siteDomain }) => ( + {siteName} diff --git a/packages/corewar-ui/src/features/topbar/siteHeader.js b/packages/corewar-ui/src/features/topbar/siteHeader.js index 9ac53df3..06d5846e 100644 --- a/packages/corewar-ui/src/features/topbar/siteHeader.js +++ b/packages/corewar-ui/src/features/topbar/siteHeader.js @@ -20,7 +20,7 @@ const Header = styled.header` const SiteHeader = ({ isAuthenticated, history }) => (
- + {isAuthenticated ? : }
) diff --git a/packages/corewar-ui/src/styles/tailwind.css b/packages/corewar-ui/src/styles/tailwind.css index 85d3c321..7f111643 100644 --- a/packages/corewar-ui/src/styles/tailwind.css +++ b/packages/corewar-ui/src/styles/tailwind.css @@ -615,6 +615,12 @@ video { } } +.guidance:hover > section { + opacity: 1; + -webkit-transition: 0.5s; + transition: 0.5s; +} + .sr-only { position: absolute; width: 1px; @@ -10854,11 +10860,11 @@ video { } .grid-rows-mobile-home-grid { - grid-template-rows: 48px 25vh repeat(8, auto) 100px; + grid-template-rows: minmax(48px, 1fr) 25vh repeat(8, auto) 100px; } .grid-rows-home-grid { - grid-template-rows: 48px 50vh repeat(8, auto) 100px; + grid-template-rows: minmax(48px, 1fr) 50vh repeat(8, auto) 100px; } .grid-rows-roadmap { @@ -12744,12 +12750,6 @@ video { transition-duration: 1000ms; } -.guidance:hover > section { - opacity: 1; - -webkit-transition: 0.5s; - transition: 0.5s; -} - @media (min-width: 640px) { .sm\:sr-only { position: absolute; @@ -22990,11 +22990,11 @@ video { } .sm\:grid-rows-mobile-home-grid { - grid-template-rows: 48px 25vh repeat(8, auto) 100px; + grid-template-rows: minmax(48px, 1fr) 25vh repeat(8, auto) 100px; } .sm\:grid-rows-home-grid { - grid-template-rows: 48px 50vh repeat(8, auto) 100px; + grid-template-rows: minmax(48px, 1fr) 50vh repeat(8, auto) 100px; } .sm\:grid-rows-roadmap { @@ -35121,11 +35121,11 @@ video { } .md\:grid-rows-mobile-home-grid { - grid-template-rows: 48px 25vh repeat(8, auto) 100px; + grid-template-rows: minmax(48px, 1fr) 25vh repeat(8, auto) 100px; } .md\:grid-rows-home-grid { - grid-template-rows: 48px 50vh repeat(8, auto) 100px; + grid-template-rows: minmax(48px, 1fr) 50vh repeat(8, auto) 100px; } .md\:grid-rows-roadmap { @@ -47252,11 +47252,11 @@ video { } .lg\:grid-rows-mobile-home-grid { - grid-template-rows: 48px 25vh repeat(8, auto) 100px; + grid-template-rows: minmax(48px, 1fr) 25vh repeat(8, auto) 100px; } .lg\:grid-rows-home-grid { - grid-template-rows: 48px 50vh repeat(8, auto) 100px; + grid-template-rows: minmax(48px, 1fr) 50vh repeat(8, auto) 100px; } .lg\:grid-rows-roadmap { @@ -59383,11 +59383,11 @@ video { } .xl\:grid-rows-mobile-home-grid { - grid-template-rows: 48px 25vh repeat(8, auto) 100px; + grid-template-rows: minmax(48px, 1fr) 25vh repeat(8, auto) 100px; } .xl\:grid-rows-home-grid { - grid-template-rows: 48px 50vh repeat(8, auto) 100px; + grid-template-rows: minmax(48px, 1fr) 50vh repeat(8, auto) 100px; } .xl\:grid-rows-roadmap { diff --git a/packages/corewar-ui/tailwind.config.js b/packages/corewar-ui/tailwind.config.js index ca205947..15fa3457 100644 --- a/packages/corewar-ui/tailwind.config.js +++ b/packages/corewar-ui/tailwind.config.js @@ -22,8 +22,8 @@ module.exports = { success: '#6FCF97' }, gridTemplateRows: { - 'mobile-home-grid': '48px 25vh repeat(8, auto) 100px', - 'home-grid': '48px 50vh repeat(8, auto) 100px', + 'mobile-home-grid': 'minmax(48px, 1fr) 25vh repeat(8, auto) 100px', + 'home-grid': 'minmax(48px, 1fr) 50vh repeat(8, auto) 100px', roadmap: '80px 1fr' }, gridTemplateColumns: { From 23a7af251e356ab2f37632436c33c61d15b7eaaa Mon Sep 17 00:00:00 2001 From: Doug McDonald Date: Sun, 15 Mar 2020 12:31:26 +0000 Subject: [PATCH 05/10] Extract links into components --- .../corewar-ui/src/features/common/link.js | 10 ++++++++++ .../src/features/common/mobileLink.js | 10 ++++++++++ .../corewar-ui/src/features/common/siteNav.js | 20 ++----------------- 3 files changed, 22 insertions(+), 18 deletions(-) create mode 100644 packages/corewar-ui/src/features/common/link.js create mode 100644 packages/corewar-ui/src/features/common/mobileLink.js diff --git a/packages/corewar-ui/src/features/common/link.js b/packages/corewar-ui/src/features/common/link.js new file mode 100644 index 00000000..a26a42b7 --- /dev/null +++ b/packages/corewar-ui/src/features/common/link.js @@ -0,0 +1,10 @@ +import React from 'react' + +export default () => ({ route, children }) => ( + + {children} + +) diff --git a/packages/corewar-ui/src/features/common/mobileLink.js b/packages/corewar-ui/src/features/common/mobileLink.js new file mode 100644 index 00000000..f85427cf --- /dev/null +++ b/packages/corewar-ui/src/features/common/mobileLink.js @@ -0,0 +1,10 @@ +import React from 'react' + +export default () => ({ route, children }) => ( + + {children} + +) diff --git a/packages/corewar-ui/src/features/common/siteNav.js b/packages/corewar-ui/src/features/common/siteNav.js index 681cf7dd..612feb7c 100644 --- a/packages/corewar-ui/src/features/common/siteNav.js +++ b/packages/corewar-ui/src/features/common/siteNav.js @@ -1,24 +1,8 @@ import React, { useState } from 'react' import Logo from '../topbar/logo' - -const Link = ({ route, children }) => ( - - {children} - -) - -const MobileLink = ({ route, children }) => ( - - {children} - -) +import Link from './link' +import MobileLink from './mobileLink' const links = [ { route: `/app/editor/src`, text: `play` }, From 191e26aea33e25c218b01fa467b4de8e0fc9840a Mon Sep 17 00:00:00 2001 From: Doug McDonald Date: Sun, 15 Mar 2020 12:39:53 +0000 Subject: [PATCH 06/10] fix alignment of roadmap items --- packages/corewar-ui/src/features/onboarding/roadmapItem.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/corewar-ui/src/features/onboarding/roadmapItem.js b/packages/corewar-ui/src/features/onboarding/roadmapItem.js index 20bb1733..b9e1ec6a 100644 --- a/packages/corewar-ui/src/features/onboarding/roadmapItem.js +++ b/packages/corewar-ui/src/features/onboarding/roadmapItem.js @@ -3,13 +3,13 @@ import Octicon from 'react-octicon' export default ({ item }) => (
-
+
{item.leftText}
-
+
{item.rightText}
From d16e1a9eef86fc1baf3aed7588defd4bab89595d Mon Sep 17 00:00:00 2001 From: Doug McDonald Date: Sun, 15 Mar 2020 13:49:54 +0000 Subject: [PATCH 07/10] Fix stupidity --- .../corewar-ui/src/features/common/link.js | 2 +- .../src/features/common/mobileLink.js | 2 +- .../corewar-ui/src/features/common/siteNav.js | 4 +- .../corewar-ui/src/features/navbar/navbar.js | 2 +- .../features/{common => navbar}/tabLink.js | 0 .../corewar-ui/src/features/topbar/logo.js | 38 +++---------------- .../src/features/topbar/siteHeader.js | 2 +- 7 files changed, 12 insertions(+), 38 deletions(-) rename packages/corewar-ui/src/features/{common => navbar}/tabLink.js (100%) diff --git a/packages/corewar-ui/src/features/common/link.js b/packages/corewar-ui/src/features/common/link.js index a26a42b7..7053aedd 100644 --- a/packages/corewar-ui/src/features/common/link.js +++ b/packages/corewar-ui/src/features/common/link.js @@ -1,6 +1,6 @@ import React from 'react' -export default () => ({ route, children }) => ( +export default ({ route, children }) => ( ({ route, children }) => ( +export default ({ route, children }) => ( { const [isExpanded, toggleExpansion] = useState(false) return (
-
- +
+