Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Landing Page Demo with Bootstrap #12

Merged
merged 4 commits into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,8 @@ module.exports = ({ config }) => {
})

config.module.rules.push({
test: /\.css$/,
use: [
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: [
require('postcss-import'),
require('tailwindcss'),
require('autoprefixer')
]
}
}
],
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
include: path.resolve(__dirname, '../')
})

Expand Down
4 changes: 1 addition & 3 deletions components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ type Props = {
}

const Button = ({ text }: Props) => (
<button className="bg-blue-500 hover: bg-blue-700 text-white font-bold py-2 px-4 rounded ml-4 mt-4">
{text}
</button>
<button className="btn btn-primary">{text}</button>
)

export default Button
34 changes: 34 additions & 0 deletions components/LandingNav.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import * as React from 'react'
import '../scss/navbar.scss'

const LandingNav = () => {
return (
<nav className="navbar navbar-expand-lg navbar-light justify-content-between">
<a className="navbar-brand text-primary" href="#">
C0D3
</a>
<div className="" id="navbarNav">
<div className="navbar-nav collapse navbar-collapse">
<a className="nav-item nav-link active" href="#">
Home <span className="sr-only">(current)</span>
</a>
<a className="nav-item nav-link" href="#">
Why Us?
</a>
<a className="nav-item nav-link" href="#">
Journey
</a>
<a className="nav-item nav-link" href="#">
Contact Us
</a>
</div>
</div>
<div>
<button className="btn border mr-3">Login</button>
<button className="btn btn-primary">Join Waitlist</button>
</div>
</nav>
)
}

export default LandingNav
4 changes: 2 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
const withCSS = require('@zeit/next-css')
module.exports = withCSS({})
const withSass = require('@zeit/next-sass')
module.exports = withSass({})
16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
"type-check": "tsc"
},
"dependencies": {
"@zeit/next-css": "^1.0.1",
"@zeit/next-sass": "^1.0.1",
"bootstrap": "^4.4.1",
"identity-obj-proxy": "^3.0.0",
"isomorphic-unfetch": "3.0.0",
"next": "latest",
"node-sass": "^4.13.1",
"react": "^16.12.0",
"react-dom": "^16.12.0"
},
Expand All @@ -30,7 +33,6 @@
"@types/styled-jsx": "^2.2.8",
"@typescript-eslint/eslint-plugin": "^2.17.0",
"@typescript-eslint/parser": "^2.17.0",
"autoprefixer": "^9.7.4",
"babel-jest": "^25.1.0",
"babel-loader": "^8.0.6",
"babel-preset-react-app": "^9.1.0",
Expand All @@ -39,12 +41,14 @@
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-react": "^7.18.0",
"jest": "^25.1.0",
"postcss-import": "^12.0.1",
"postcss-preset-env": "^6.7.0",
"prettier": "^1.19.1",
"react-test-renderer": "^16.12.0",
"tailwindcss": "^1.1.4",
"typescript": "3.7.3"
},
"license": "ISC"
"license": "ISC",
"jest": {
"moduleNameMapper": {
"\\.(css|scss)$": "identity-obj-proxy"
}
}
}
2 changes: 1 addition & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import { AppProps } from 'next/app'
import '../styles/tailwind.css'
import '../scss/index.scss'

function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
Expand Down
7 changes: 6 additions & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import * as React from 'react'
import LandingNav from '../components/LandingNav'

const IndexPage: React.FC = () => {
return <h1 className="text-purple-400">Under Construction</h1>
return (
<div>
<LandingNav />
</div>
)
}

export default IndexPage
3 changes: 0 additions & 3 deletions postcss.config.js

This file was deleted.

9 changes: 9 additions & 0 deletions scss/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Override default variables before the import
$body-bg: #fff;

$theme-colors: (
"primary": rgb(84,64,216)
);

// Import Bootstrap and its default variables
@import '~bootstrap/scss/bootstrap.scss';
4 changes: 4 additions & 0 deletions scss/navbar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.navbar-brand {
font-family: 'PT Mono', sans-serif;
font-size: 30px;
}
2 changes: 1 addition & 1 deletion stories/Button.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import { storiesOf } from '@storybook/react'
import Button from '../components/Button'
import '../styles/tailwind.css'
import '../scss/index.scss'

storiesOf('Button', module).add('with text', () => {
return <Button text="Click Me" />
Expand Down
5 changes: 0 additions & 5 deletions styles/tailwind.css

This file was deleted.

Loading