Skip to content

Commit

Permalink
Merge pull request #583 from ONEARMY/master
Browse files Browse the repository at this point in the history
v0.6.1
  • Loading branch information
chrismclarke authored Sep 16, 2019
2 parents 0e13245 + acfa693 commit 3dc13a2
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "one-army-world",
"version": "0.6.0",
"version": "0.6.1",
"private": true,
"dependencies": {
"@babel/core": "7.2.2",
Expand Down
27 changes: 27 additions & 0 deletions src/components/ExternalEmbed/ExternalEmbed.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import * as React from 'react'

interface IProps {
src: string
}

export class ExternalEmbed extends React.Component<IProps> {
render() {
return (
<div
style={{
position: 'relative',
height: '100%',
}}
>
<iframe
src={this.props.src}
style={{
border: 0,
height: '100%',
width: '100%',
}}
/>
</div>
)
}
}
11 changes: 10 additions & 1 deletion src/pages/PageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { EventsPage } from './Events/Events'
import { AdminPage } from './admin/Admin'
import { MapsPage } from './Maps/Maps'
import { User } from './User/User'
import { ExternalEmbed } from 'src/components/ExternalEmbed/ExternalEmbed'
import { SignUpMessagePage } from './SignUp/SignUpMessage'
import { ResendSignUpMessagePage } from './SignUp/ResendSignUpMessage'
import SignUpPage from './SignUp/SignUp'
Expand All @@ -20,6 +21,7 @@ export interface IPageMeta {
description: string
exact?: boolean
fullPageWidth?: boolean
customStyles?: React.CSSProperties
}

const howTo = {
Expand All @@ -40,6 +42,13 @@ const user = {
title: 'User profile',
description: 'User profile',
}
const academy = {
path: '/academy',
component: <ExternalEmbed src="https://onearmy.github.io/academy/intro" />,
title: 'Academy',
description: 'Demo external page embed',
customStyles: { position: 'absolute', height: '100%', width: '100%' },
}
const events = {
path: '/events',
component: <EventsPage />,
Expand Down Expand Up @@ -103,7 +112,7 @@ const forgotpasswordmessage = {
}

// community pages (various pages hidden on production build)
const devCommunityPages = [howTo, events, maps]
const devCommunityPages = [howTo, events, maps, academy]
const prodCommunityPages = [howTo, events, maps]
const communityPages =
SITE === 'production' ? prodCommunityPages : devCommunityPages
Expand Down
2 changes: 2 additions & 0 deletions src/pages/SignIn/SignIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class SignInPage extends React.Component<IProps, IState> {
email: props.preloadValues ? props.preloadValues.email : '',
password: props.preloadValues ? props.preloadValues.password : '',
},
// TODO remove initialization of authProvider state when DH login will be fixed
authProvider: AUTH_PROVIDERS[1],
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/pages/common/Layout/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ type InnerContainerProps = MaxWidthProps &
}

const InnerContainer = styled(Box)<InnerContainerProps>`
${space}
${width}
${props => (props.ignoreMaxWidth ? 'max-width: inherit;' : maxWidth)}
margin: ${p => (p.ignoreMaxWidth ? 0 : undefined)};
padding: ${p => (p.ignoreMaxWidth ? 0 : undefined)};
position: relative;
height: 100%;
`
interface IProps extends FlexProps {
ignoreMaxWidth?: boolean
Expand Down
5 changes: 4 additions & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ export class Routes extends React.Component<any, IState> {
render={props => (
<React.Fragment>
<Header />
<Main ignoreMaxWidth={page.fullPageWidth}>
<Main
ignoreMaxWidth={page.fullPageWidth}
style={page.customStyles}
>
<>{page.component}</>
</Main>
</React.Fragment>
Expand Down

0 comments on commit 3dc13a2

Please sign in to comment.