Compare commits

...

3 Commits

Author SHA1 Message Date
0743fa3576 Updates snaps with new classnames
All checks were successful
gitea-deepak/gog_frontend/pipeline/head This commit looks good
2021-02-01 12:29:44 -06:00
ee7bcbcdfe Adds stylelint and related changes 2021-02-01 12:28:51 -06:00
d182657b44 fmt results 2021-02-01 12:14:03 -06:00
11 changed files with 1586 additions and 33 deletions

6
.stylelintrc.json Normal file
View File

@@ -0,0 +1,6 @@
{
"extends": "stylelint-config-sass-guidelines",
"rules": {
"indentation": "tab"
}
}

6
Jenkinsfile vendored
View File

@@ -26,6 +26,12 @@ pipeline {
sh './do.sh _lint' sh './do.sh _lint'
} }
} }
stage('stylelint') {
steps {
echo 'Running stylelint'
sh './do.sh _stylelint'
}
}
stage('test') { stage('test') {
steps { steps {
echo 'Running test' echo 'Running test'

6
do.sh
View File

@@ -22,6 +22,10 @@ _lint() {
npx eslint src --ext .js,.jsx npx eslint src --ext .js,.jsx
} }
_stylelint() {
npx stylelint "src/**/*.{css,scss,sass}"
}
_jest() { _jest() {
npx jest --ci --coverage npx jest --ci --coverage
} }
@@ -32,7 +36,7 @@ _jestUpdateSnaps() {
test() { test() {
echo "I am ${FUNCNAME[0]}ing" echo "I am ${FUNCNAME[0]}ing"
_lint && _jest _lint && _stylelint && _jest
} }
"$@" # <- execute the task "$@" # <- execute the task

1543
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -62,6 +62,8 @@
"sass": "^1.32.5", "sass": "^1.32.5",
"sass-loader": "^10.1.1", "sass-loader": "^10.1.1",
"style-loader": "^2.0.0", "style-loader": "^2.0.0",
"stylelint": "^13.9.0",
"stylelint-config-sass-guidelines": "^7.1.0",
"webpack": "^5.19.0", "webpack": "^5.19.0",
"webpack-cli": "^4.3.1", "webpack-cli": "^4.3.1",
"webpack-dev-server": "^3.11.1" "webpack-dev-server": "^3.11.1"

View File

@@ -9,7 +9,7 @@ function App() {
const { user } = useAuth(); const { user } = useAuth();
console.log(user); console.log(user);
return ( return (
<div className="App"> <div className="app">
<h1>Frontend</h1> <h1>Frontend</h1>
{user ? <AuthenticatedApp /> : <UnauthenticatedApp />} {user ? <AuthenticatedApp /> : <UnauthenticatedApp />}
</div> </div>

View File

@@ -1,15 +1,10 @@
@use "./common_styles/typography" as t; @use './common_styles/typography' as t;
@use "./common_styles/colours"; @use './common_styles/colours';
.App { .app {
font: t.$stack; font: t.$stack;
line-height: 1.5;
margin: 1rem; margin: 1rem;
line-height: 1.5
}
.mainContent {
width: 80%;
margin: auto;
} }
body { body {

View File

@@ -15,11 +15,11 @@
// } // }
@font-face { @font-face {
src: url("fonts/Trilby-Regular-Testing.woff2") format("woff2"), font-family: 'Trilby';
url("fonts/Trilby-Regular-Testing.woff") format("woff");
font-family: "Trilby";
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
src: url('fonts/Trilby-Regular-Testing.woff2') format('woff2'),
url('fonts/Trilby-Regular-Testing.woff') format('woff');
} }
$stack: 14px "Trilby", "Century Gothic", Futura, sans-serif; $stack: 14px 'Trilby', 'Century Gothic', Futura, sans-serif;

View File

@@ -15,19 +15,19 @@ function UnauthenticatedApp() {
<Login login={login} /> <Login login={login} />
); );
return ( return (
<div className="UnauthenticatedApp"> <div className="unauthenticated-app">
<div className="loginRegisterButtonsWrapper"> <div className="button-wrapper">
<button <button
type="submit" type="submit"
onClick={() => setShowRegister(false)} onClick={() => setShowRegister(false)}
className="chooseLogin" className="choose-login"
> >
Login Login
</button> </button>
<button <button
type="submit" type="submit"
onClick={() => setShowRegister(true)} onClick={() => setShowRegister(true)}
className="chooseRegister" className="choose-register"
> >
Register Register
</button> </button>

View File

@@ -1,19 +1,16 @@
@use "../common_styles/colours"; @use '../common_styles/colours';
@use "../common_styles/typography"; @use '../common_styles/typography';
.UnauthenticatedApp button { .unauthenticated-app button {
padding: 10px 15px;
border: 0px;
margin: 10px;
background-color: colours.$accent-color; background-color: colours.$accent-color;
border: 0;
color: colours.$inverted-text-color; color: colours.$inverted-text-color;
font: typography.$stack; font: typography.$stack;
margin: 10px;
padding: 10px 15px;
} }
.UnauthenticatedApp .chooseLogin { .unauthenticated-app .choose-register {
}
.UnauthenticatedApp .chooseRegister {
background-color: colours.$dimmed-color; background-color: colours.$dimmed-color;
color: colours.$text-color; color: colours.$text-color;
} }

View File

@@ -2,20 +2,20 @@
exports[`UnauthenticatedApp Snapshot 1`] = ` exports[`UnauthenticatedApp Snapshot 1`] = `
<div <div
className="UnauthenticatedApp" className="unauthenticated-app"
> >
<div <div
className="loginRegisterButtonsWrapper" className="button-wrapper"
> >
<button <button
className="chooseLogin" className="choose-login"
onClick={[Function]} onClick={[Function]}
type="submit" type="submit"
> >
Login Login
</button> </button>
<button <button
className="chooseRegister" className="choose-register"
onClick={[Function]} onClick={[Function]}
type="submit" type="submit"
> >