diff --git a/.eslintrc b/.eslintrc index 377e099a..9cd07d27 100644 --- a/.eslintrc +++ b/.eslintrc @@ -28,6 +28,8 @@ "react/jsx-filename-extension": "off", "react/jsx-props-no-spreading": "off", "react/forbid-prop-types": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "import/prefer-default-export": "off", "react/prop-types": [ 2, { diff --git a/src/components/index.js b/src/components/index.js index 15b52c88..a0ceb7e2 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -8,6 +8,7 @@ import FormLayout from './FormLayout'; import InputField from './InputField'; import Loading from './Loading'; import { ButtonWithConfirmationModal, ButtonWithAlertModal } from './modals'; +import { PublicPageLayout } from './layouts'; import NavBar from './NavBar'; import Table from './Table'; import Tags from './Tags'; @@ -25,4 +26,5 @@ export { NavBar, Table, Tags, + PublicPageLayout, }; diff --git a/src/components/layouts/PublicPageLayout/PublicPageLayout.stories.tsx b/src/components/layouts/PublicPageLayout/PublicPageLayout.stories.tsx new file mode 100644 index 00000000..ff112517 --- /dev/null +++ b/src/components/layouts/PublicPageLayout/PublicPageLayout.stories.tsx @@ -0,0 +1,26 @@ +import React from 'react'; +import { Card, CardContent } from '@material-ui/core'; +import { Story, Meta } from '@storybook/react'; + +import PublicPageLayout, { PublicPageLayoutProps } from './PublicPageLayout'; + +export default { + title: 'Layouts/PublicPageLayout', + component: PublicPageLayout, +} as Meta; + +const Template: Story = args => { + const { children } = args; + return {children}; +}; + +export const SamplePublicPageLayout = Template.bind({}); +SamplePublicPageLayout.args = { + children: ( + + +

Title

+
+
+ ), +}; diff --git a/src/components/layouts/PublicPageLayout/PublicPageLayout.tsx b/src/components/layouts/PublicPageLayout/PublicPageLayout.tsx new file mode 100644 index 00000000..9fc3ef63 --- /dev/null +++ b/src/components/layouts/PublicPageLayout/PublicPageLayout.tsx @@ -0,0 +1,27 @@ +import React from 'react'; +import { Grid, WithStyles, withStyles } from '@material-ui/core'; + +import styles from './styles'; + +export interface PublicPageLayoutProps extends WithStyles { + children: JSX.Element; +} + +function PublicPageLayout(props: PublicPageLayoutProps): JSX.Element { + const { children, classes } = props; + return ( + + + {children} + + + ); +} + +export default withStyles(styles)(PublicPageLayout); diff --git a/src/components/layouts/PublicPageLayout/index.ts b/src/components/layouts/PublicPageLayout/index.ts new file mode 100644 index 00000000..ac86081e --- /dev/null +++ b/src/components/layouts/PublicPageLayout/index.ts @@ -0,0 +1,3 @@ +import PublicPageLayout from './PublicPageLayout'; + +export default PublicPageLayout; diff --git a/src/components/layouts/PublicPageLayout/styles.ts b/src/components/layouts/PublicPageLayout/styles.ts new file mode 100644 index 00000000..caf8a5b2 --- /dev/null +++ b/src/components/layouts/PublicPageLayout/styles.ts @@ -0,0 +1,17 @@ +import { Theme } from '@material-ui/core'; + +const styles = (theme: Theme) => ({ + root: { + [theme.breakpoints.up('sm')]: { + marginTop: '8vh', + }, + [theme.breakpoints.only('xs')]: { + marginTop: '3vh', + }, + }, + children: { + margin: theme.spacing(2), + }, +}); + +export default styles; diff --git a/src/components/layouts/index.ts b/src/components/layouts/index.ts new file mode 100644 index 00000000..d9a60b11 --- /dev/null +++ b/src/components/layouts/index.ts @@ -0,0 +1,3 @@ +import PublicPageLayout from './PublicPageLayout'; + +export { PublicPageLayout }; diff --git a/src/index.tsx b/src/index.tsx index 894c5e45..d0d51f3b 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -18,6 +18,8 @@ const config = { firebase.initializeApp(config); +document.body.style.height = '100%'; +document.body.style.margin = '0'; ReactDOM.render(, document.getElementById('root')); serviceWorker.unregister(); diff --git a/src/pages/EventRsvpPage/index.js b/src/pages/EventRsvpPage/index.js index 5590fdab..ea222311 100644 --- a/src/pages/EventRsvpPage/index.js +++ b/src/pages/EventRsvpPage/index.js @@ -7,7 +7,7 @@ import EventRsvpForm from './components/EventRsvpForm'; import styles from './styles'; import HKN_TRIDENT_LOGO from '@Images/hkn-trident.png'; -import { Loading } from '@SharedComponents'; +import { Loading, PublicPageLayout } from '@SharedComponents'; import { getEventById } from '@Services/events'; class EventRsvpPage extends React.Component { @@ -39,8 +39,6 @@ class EventRsvpPage extends React.Component { } handleSubmit = (values, setSubmitting) => { - console.log(values); - setSubmitting(false); }; @@ -52,7 +50,7 @@ class EventRsvpPage extends React.Component { eventInfo == null ? ( ) : ( -
+ @@ -87,7 +85,7 @@ class EventRsvpPage extends React.Component { -
+ ); return EventRsvp; diff --git a/src/pages/EventSignInPage/index.js b/src/pages/EventSignInPage/index.js index 3c4d6b59..173aa378 100644 --- a/src/pages/EventSignInPage/index.js +++ b/src/pages/EventSignInPage/index.js @@ -7,7 +7,7 @@ import EventSignInForm from './components/EventSignInForm'; import styles from './styles'; import HKN_TRIDENT_LOGO from '@Images/hkn-trident.png'; -import { Loading } from '@SharedComponents'; +import { Loading, PublicPageLayout } from '@SharedComponents'; import { getEventById } from '@Services/events'; import { signInToEvent } from '@Services/ApiEvents'; @@ -42,8 +42,6 @@ class EventSignInPage extends React.Component { handleSubmit = (values, setSubmitting) => { const { eventId } = this.state; - console.log(values); - signInToEvent(eventId, values); setSubmitting(false); @@ -57,7 +55,7 @@ class EventSignInPage extends React.Component { eventInfo == null ? ( ) : ( -
+ @@ -92,7 +90,7 @@ class EventSignInPage extends React.Component { -
+ ); return EventSignIn; diff --git a/src/pages/SignUpPage/index.js b/src/pages/SignUpPage/index.js index 8ac019e7..13306fb1 100644 --- a/src/pages/SignUpPage/index.js +++ b/src/pages/SignUpPage/index.js @@ -5,6 +5,7 @@ import { withStyles } from '@material-ui/core/styles'; import SignUpForm from './components/SignUpForm'; import styles from './styles'; +import { PublicPageLayout } from '@SharedComponents/layouts'; import { createUserAccountFromSignup } from '@Services/auth'; import HKN_TRIDENT_LOGO from '@Images/hkn-trident.png'; @@ -31,34 +32,26 @@ class SignUpPage extends React.Component { const { classes } = this.props; return ( - - - - - - - - - - - + + + + + + - - - - + + + + + + + ); } }