Skip to content

Commit

Permalink
feat: add package core and remove 'remember me' checkbox from login v…
Browse files Browse the repository at this point in the history
…iew (#4)
  • Loading branch information
Jozwiaczek authored Jan 10, 2021
1 parent 883e3df commit 0bde240
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"packages/*"
],
"scripts": {
"check": "yarn type-check && yarn lint:fix && yarn prettier:fix && yarn test && yarn sortPackageJson",
"check": "yarn lint:fix && yarn prettier:fix && yarn type-check && yarn test && yarn sortPackageJson",
"preinstall": "node -e \"if (process.env.npm_execpath.indexOf('yarn') === -1) throw new Error('Use yarn for installing')\"",
"lint": "lerna run lint",
"lint:fix": "lerna run lint:fix",
Expand Down
15 changes: 2 additions & 13 deletions packages/client/src/containers/SignIn/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import React from 'react';
import Card from '@material-ui/core/Card';
import Avatar from '@material-ui/core/Avatar';
import Button from '@material-ui/core/Button';
import Checkbox from '@material-ui/core/Checkbox';
import Container from '@material-ui/core/Container';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import Grid from '@material-ui/core/Grid';
import MuiLink from '@material-ui/core/Link';
import { makeStyles } from '@material-ui/core/styles';
Expand All @@ -13,6 +11,7 @@ import Typography from '@material-ui/core/Typography';
import LockOutlinedIcon from '@material-ui/icons/LockOutlined';
import { Link } from 'react-router-dom';
import { useForm } from 'react-hook-form';
import { Users } from 'smart-gate-core';

const useStyles = makeStyles((theme) => ({
paper: {
Expand All @@ -35,11 +34,7 @@ const useStyles = makeStyles((theme) => ({
},
}));

type Inputs = {
email: string;
password: string;
remember: boolean;
};
type Inputs = Users;

const SignIn = () => {
const classes = useStyles();
Expand Down Expand Up @@ -82,12 +77,6 @@ const SignIn = () => {
autoComplete="current-password"
inputRef={register({ required: true })}
/>
<FormControlLabel
name="remember"
control={<Checkbox color="primary" />}
label="Remember me"
inputRef={register}
/>
<Button
type="submit"
fullWidth
Expand Down
3 changes: 3 additions & 0 deletions packages/core/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../.eslintrc"
}
3 changes: 3 additions & 0 deletions packages/core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Smart Gate - Core

Set of core elements for smart-gate packages.
12 changes: 12 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "smart-gate-core",
"version": "0.0.1",
"private": true,
"description": "Set of core elements for smart-gate packages.",
"main": "src/index.js",
"scripts": {
"lint": "eslint \"**/*.{js,jsx,ts,tsx}\" --cache",
"lint:fix": "yarn lint --fix",
"type-check": "tsc --noEmit"
}
}
1 change: 1 addition & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './models';
4 changes: 4 additions & 0 deletions packages/core/src/models.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface Users {
email: string;
password: string;
}
10 changes: 10 additions & 0 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.settings.json",
"compilerOptions": {
"baseUrl": "./",
"composite": true,
"isolatedModules": false
},
"include": ["src"],
"exclude": ["node_modules", "**/*spec.ts"]
}

0 comments on commit 0bde240

Please sign in to comment.