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

v0.6.1 #583

Merged
merged 9 commits into from
Sep 16, 2019
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
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