-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add app sections to make app.tsx more readable * treat screens with width less than 992px as mobile screens At point 992 is where the screen breaks
- Loading branch information
Showing
6 changed files
with
176 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { IconButton, IStackTokens, Label, Stack } from 'office-ui-fabric-react'; | ||
import React from 'react'; | ||
import { Authentication } from '../authentication'; | ||
import { Banner } from '../opt-in-out-banner'; | ||
|
||
export function appTitleDisplayOnFullScreen( | ||
classes: any, | ||
minimised: any, | ||
toggleSidebar: Function, | ||
optOut: Function | ||
): React.ReactNode { | ||
|
||
return <div style={{ display: 'flex', width: '100%' }}> | ||
<IconButton | ||
iconProps={{ iconName: 'GlobalNavButton' }} | ||
className={classes.sidebarToggle} | ||
title='Minimise sidebar' | ||
ariaLabel='Minimise sidebar' | ||
onClick={() => toggleSidebar()} /> | ||
<div className={classes.graphExplorerLabelContainer}> | ||
{!minimised && | ||
<> | ||
<Label className={classes.graphExplorerLabel}> | ||
Graph Explorer | ||
</Label> | ||
<span className={classes.previewButton}> | ||
<Banner optOut={() => optOut()} /> | ||
</span> | ||
</>} | ||
</div> | ||
</div>; | ||
} | ||
|
||
export function appTitleDisplayOnMobileScreen( | ||
stackTokens: IStackTokens, | ||
classes: any, | ||
toggleSidebar: Function, | ||
optOut: Function | ||
): React.ReactNode { | ||
return <Stack horizontal={true} disableShrink={true} tokens={stackTokens}> | ||
<> | ||
<IconButton | ||
iconProps={{ iconName: 'GlobalNavButton' }} | ||
className={classes.sidebarToggle} | ||
title='Remove sidebar' | ||
ariaLabel='Remove sidebar' | ||
onClick={() => toggleSidebar()} | ||
/> | ||
<div style={{ padding: 10 }}> | ||
<Label className={classes.graphExplorerLabel}> | ||
Graph Explorer | ||
</Label> | ||
<Banner optOut={() => optOut()} /> | ||
</div> | ||
<span style={{ | ||
position: 'absolute', | ||
marginLeft: '70%', | ||
marginTop: '2.5%' | ||
}}> | ||
<Authentication /> | ||
</span> | ||
</> | ||
</Stack>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { MessageBar, MessageBarType } from 'office-ui-fabric-react'; | ||
import React from 'react'; | ||
import { FormattedMessage } from 'react-intl'; | ||
import { LoginType } from '../../../types/enums'; | ||
import { Authentication } from '../authentication'; | ||
export function headerMessaging(loginType: LoginType, classes: any, query: string): React.ReactNode { | ||
return ( | ||
<div style={{ marginBottom: 8 }}> | ||
{loginType === LoginType.Popup && <> | ||
<MessageBar messageBarType={MessageBarType.info} isMultiline={true}> | ||
<p> | ||
<FormattedMessage id='To try the full features' />, | ||
<a className={classes.links} tabIndex={0} href={query} target='_blank'> | ||
<FormattedMessage id='full Graph Explorer' />. | ||
</a> | ||
</p> | ||
<p> | ||
<FormattedMessage id='running the query' />. | ||
</p> | ||
</MessageBar> | ||
|
||
<Authentication /> | ||
</>} | ||
{loginType === LoginType.Redirect && <MessageBar messageBarType={MessageBarType.warning} isMultiline={true}> | ||
<p> | ||
<FormattedMessage id='To try operations other than GET' />, | ||
|
||
<a className={classes.links} tabIndex={0} href={query} target='_blank'> | ||
<FormattedMessage id='sign in' />. | ||
</a> | ||
</p> | ||
</MessageBar>} | ||
</div>); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { MessageBar } from 'office-ui-fabric-react'; | ||
import React from 'react'; | ||
import { FormattedMessage } from 'react-intl'; | ||
export function statusMessages(queryState: any, actions: any) { | ||
return queryState && ( | ||
<MessageBar messageBarType={queryState.messageType} | ||
isMultiline={false} onDismiss={actions.clearQueryStatus}> | ||
{`${queryState.statusText} - ${queryState.status} `} | ||
{queryState.duration && <> | ||
{`- ${queryState.duration}`}<FormattedMessage id='milliseconds' /> | ||
</>} | ||
|
||
{queryState.status === 403 && <>. | ||
<FormattedMessage id='consent to scopes' /> | ||
<span style={{ fontWeight: 600 }}> | ||
<FormattedMessage id='modify permissions' /> | ||
</span> | ||
<FormattedMessage id='tab' /> | ||
</>} | ||
|
||
</MessageBar>); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { MessageBar, MessageBarType } from 'office-ui-fabric-react'; | ||
import React from 'react'; | ||
import { FormattedMessage } from 'react-intl'; | ||
export function termsOfUseMessage(termsOfUse: any, actions: any, classes: any, language: string) { | ||
return termsOfUse && ( | ||
<MessageBar messageBarType={MessageBarType.info} | ||
isMultiline={false} onDismiss={actions.clearTermsOfUse}> | ||
<FormattedMessage id='use the Microsoft Graph API' /> | ||
<a className={classes.links} href={'https://docs.microsoft.com/' + language + | ||
'/legal/microsoft-apis/terms-of-use?context=graph/context'} target='_blank'> | ||
<FormattedMessage id='Terms of use' /></a>. | ||
<FormattedMessage id='View the' /> | ||
<a className={classes.links} href={'https://privacy.microsoft.com/' + language + '/privacystatement'} | ||
target='_blank'> | ||
<FormattedMessage id='Microsoft Privacy Statement' /></a> | ||
</MessageBar>); | ||
} |
Oops, something went wrong.