App layout prop update

This commit is contained in:
tmshv committed 2019-10-17 14:50:09 +03:00
1 parent 228e7824de
commit 3902815113
11 files changed
+89 -100

No files matched your search

+10 -11
View File
@@ -12,21 +12,20 @@ const Page = (props) => (
menu={buildMenu(props.pageUrl, menuModel)} menu={buildMenu(props.pageUrl, menuModel)}
showAuthor={true} showAuthor={true}
menuPadding={true} menuPadding={true}
layout={'thin'}
> >
<Head> <Head>
<title>{props.album.title}</title> <title>{props.album.title}</title>
</Head> </Head>
<div className="content content_thin"> <Article
<Article title={props.album.title}
title={props.album.title} date={props.album.date}
date={props.album.date} shareable={true}
shareable={true} >
> <Html
<Html html={props.album.post}
html={props.album.post} />
/> </Article>
</Article>
</div>
</App> </App>
) )
+11 -12
View File
@@ -15,23 +15,22 @@ const Page = (props) => (
menu={buildMenu(props.pageUrl, menuModel)} menu={buildMenu(props.pageUrl, menuModel)}
showAuthor={true} showAuthor={true}
menuPadding={true} menuPadding={true}
layout={'thin'}
> >
<Head> <Head>
<title>{props.article.title}</title> <title>{props.article.title}</title>
<Meta meta={props.meta} /> <Meta meta={props.meta} />
</Head> </Head>
<div className={'content content_thin'}> <Article
<Article title={props.article.title}
title={props.article.title} date={props.article.date}
date={props.article.date} tags={props.article.tags}
tags={props.article.tags} shareable={true}
shareable={true} >
> <Html
<Html html={props.article.post}
html={props.article.post} />
/> </Article>
</Article>
</div>
</App> </App>
) )
+6 -7
View File
@@ -13,18 +13,17 @@ const Page = (props) => (
menu={buildMenu(props.pageUrl, menuModel)} menu={buildMenu(props.pageUrl, menuModel)}
showAuthor={true} showAuthor={true}
menuPadding={true} menuPadding={true}
layout={'wide'}
> >
<Head> <Head>
<title>{props.title}</title> <title>{props.title}</title>
<Meta meta={props.meta} /> <Meta meta={props.meta} />
</Head> </Head>
<div className="content content_wide"> <ArticleCardList
<ArticleCardList articles={props.articles}
articles={props.articles} prevPage={props.prevPage}
prevPage={props.prevPage} nextPage={props.nextPage}
nextPage={props.nextPage} />
/>
</div>
</App> </App>
) )
+20 -21
View File
@@ -16,35 +16,34 @@ const Page = (props) => (
menu={buildMenu(props.pageUrl, menuModel)} menu={buildMenu(props.pageUrl, menuModel)}
showAuthor={true} showAuthor={true}
menuPadding={true} menuPadding={true}
layout={'wide'}
> >
<Head> <Head>
<title>{props.title}</title> <title>{props.title}</title>
<Meta meta={props.meta} /> <Meta meta={props.meta} />
</Head> </Head>
<div className="content content_semi-wide"> {!props.image ? null : (
{!props.image ? null : ( <CollectiveImage
<CollectiveImage data={props.image}
data={props.image} style={{
style={{ marginBottom: 'var(--double-margin)',
marginBottom: 'var(--double-margin)', }}
}} />
)}
<CardList
items={props.persons}
renderItem={(person, index) => (
<PersonCard
key={index}
profile={person}
picture={person.picture}
url={person.url}
name={person.name}
/> />
)} )}
/>
<CardList
items={props.persons}
renderItem={(person, index) => (
<PersonCard
key={index}
profile={person}
picture={person.picture}
url={person.url}
name={person.name}
/>
)}
/>
</div>
</App> </App>
) )
+3 -4
View File
@@ -14,15 +14,14 @@ const Page = (props) => (
menu={buildMenu(props.pageUrl, menuModel)} menu={buildMenu(props.pageUrl, menuModel)}
showAuthor={true} showAuthor={true}
menuPadding={true} menuPadding={true}
layout={'wide'}
> >
<Head> <Head>
<title>{props.file.title}</title> <title>{props.file.title}</title>
<Meta meta={props.meta} /> <Meta meta={props.meta} />
</Head> </Head>
<div className="content content_wide"> <Document {...props.file} />
<Document {...props.file} /> <Share />
<Share />
</div>
</App> </App>
) )
+8 -9
View File
@@ -106,21 +106,20 @@ const Page: NextPage<IProps> = props => (
menu={buildMenu(props.pageUrl, menuModel)} menu={buildMenu(props.pageUrl, menuModel)}
showAuthor={true} showAuthor={true}
menuPadding={true} menuPadding={true}
layout={'thin'}
> >
<Head> <Head>
<title>{props.title}</title> <title>{props.title}</title>
<Meta meta={props.meta} /> <Meta meta={props.meta} />
</Head> </Head>
<div className="content content_thin"> {props.collections.map((collection, index) => (
{props.collections.map((collection, index) => ( <DocumentList
<DocumentList key={index}
key={index} name={collection.name}
name={collection.name} documents={collection.items}
documents={collection.items} />
/> ))}
))}
</div>
</App> </App>
) )
+14 -15
View File
@@ -69,27 +69,26 @@ const Page = (props) => (
menu={buildMenu(props.pageUrl, menuModel)} menu={buildMenu(props.pageUrl, menuModel)}
showAuthor={true} showAuthor={true}
menuPadding={true} menuPadding={true}
layout={'wide'}
> >
<Head> <Head>
<title>{props.title}</title> <title>{props.title}</title>
<Meta meta={props.meta} /> <Meta meta={props.meta} />
</Head> </Head>
<div className="content content_semi-wide"> <Article
<Article // title={meta.title}
// title={meta.title} title={'Галерея'}
title={'Галерея'} >
> {props.collections.map(([year, albums], index) => (
{props.collections.map(([year, albums], index) => ( <ACollection
<ACollection key={index}
key={index} title={year}
title={year} albums={albums}
albums={albums} />
/> ))
)) }
} </Article>
</Article>
</div>
</App> </App>
) )
+7 -8
View File
@@ -14,21 +14,20 @@ const Page = (props) => (
menu={buildMenu(props.pageUrl, menuModel)} menu={buildMenu(props.pageUrl, menuModel)}
showAuthor={true} showAuthor={true}
menuPadding={true} menuPadding={true}
layout={'wide'}
> >
<Head> <Head>
<title>{props.title}</title> <title>{props.title}</title>
<Meta meta={props.meta} /> <Meta meta={props.meta} />
</Head> </Head>
<div className="content content_wide"> <HudozkaTitle />
<HudozkaTitle />
<ArticleCardList <ArticleCardList
articles={props.articles} articles={props.articles}
prevPage={props.prevPage} prevPage={props.prevPage}
nextPage={props.nextPage} nextPage={props.nextPage}
/> />
</div>
</App> </App>
) )
+4 -5
View File
@@ -12,18 +12,17 @@ const Page = (props) => (
menu={buildMenu(props.pageUrl, menuModel)} menu={buildMenu(props.pageUrl, menuModel)}
showAuthor={true} showAuthor={true}
menuPadding={true} menuPadding={true}
layout={'wide'}
> >
<Head> <Head>
<title>{props.title}</title> <title>{props.title}</title>
</Head> </Head>
<div className="content content_wide"> {/*<ScheduleList schedules={schedules}/>*/}
{/*<ScheduleList schedules={schedules}/>*/}
<Schedule {...props.schedule} /> <Schedule {...props.schedule} />
<Share /> <Share />
</div>
</App> </App>
) )
+4 -5
View File
@@ -14,16 +14,15 @@ const Index = (props) => (
menu={buildMenu(props.pageUrl, menuModel)} menu={buildMenu(props.pageUrl, menuModel)}
showAuthor={true} showAuthor={true}
menuPadding={true} menuPadding={true}
layout={'wide'}
> >
<Head> <Head>
<title>{props.title}</title> <title>{props.title}</title>
<Meta meta={props.meta} /> <Meta meta={props.meta} />
</Head> </Head>
<div className="content content_thin"> <Page shareable={true}>
<Page shareable={true}> {props.person.post}
{props.person.post} </Page>
</Page>
</div>
</App> </App>
) )
+2 -3
View File
@@ -16,11 +16,10 @@ export interface IAppProps {
menu: any menu: any
showAuthor: boolean showAuthor: boolean
menuPadding: boolean menuPadding: boolean
layout?: 'full' | 'wide' | 'thin' layout: 'full' | 'wide' | 'thin'
} }
export const App: React.FC<IAppProps> = props => { export const App: React.FC<IAppProps> = props => {
const layout = props.layout ? props.layout : 'full'
const motionDisabled = useReducedMotion() const motionDisabled = useReducedMotion()
return ( return (
@@ -36,7 +35,7 @@ export const App: React.FC<IAppProps> = props => {
</header> </header>
<main className="body-wrapper__content"> <main className="body-wrapper__content">
<section className={cx('content', `content_${layout}`, { <section className={cx('content', `content_${props.layout}`, {
'content--padding-top--menu': props.menuPadding, 'content--padding-top--menu': props.menuPadding,
'reduced-motion': motionDisabled, 'reduced-motion': motionDisabled,
})}> })}>