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

CustomContainer Component Created & Implemented and Data Added to Contact Page #77

Merged
merged 5 commits into from
Feb 18, 2021
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
46 changes: 46 additions & 0 deletions components/custom-container/custom-container.component.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React, { CSSProperties, ReactElement, ReactNode } from 'react'

import styles from './custom-container.module.scss'
import classNames from 'classnames'

interface Props {
page?: string
children: ReactNode
h1?: string
h2?: string
h3?: string
justifyContent?: string
}

export default function CustomContainer ({
page,
children,
h1,
h2,
h3,
justifyContent
}: Props
): ReactElement {
const style: CSSProperties = {
justifyContent
}
return (
<div className={styles.container}>
{
h1 !== undefined && <h1 className={styles.h1}>{h1}</h1>
}
{
h2 !== undefined && <h2 className={styles.h2}>{h3}</h2>
}
{
h3 !== undefined && <h3 className={styles.h3}>{h3}</h3>
}
<div className={classNames(
styles.body,
page === 'about-us' && styles.body_aboutUs,
page === 'contact' && styles.body_contact)} style={style}>
{children}
</div>
</div>
)
}
75 changes: 75 additions & 0 deletions components/custom-container/custom-container.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
@use "../../global/variables.scss" as variables;

.container {
display: flex;
flex-direction: column;
align-items: center;
min-width: 100%;
padding: 2.4rem 0;

.h1 {
font-family: "Zaph Humanist", sans-serif;
font-size: 3rem;
text-transform: uppercase;
color: variables.$secondary-color;
margin-bottom: 2.4rem;

@media only screen and (max-width: variables.$max-width-middle) {
font-size: 2.5rem;
}
}

.h2 {
font-family: "SuisseInt-Regular", sans-serif;
font-size: 1.4rem;
color: variables.$secondary-color;
max-width: 70vw;
text-align: justify;
margin-bottom: 1.5rem;

@media only screen and (max-width: variables.$max-width-middle) {
font-size: 1rem;
}
@media only screen and (max-width: variables.$max-width-paragraph) {
text-align: center;
}
}

.h3 {
font-family: "SuisseInt-Regular", sans-serif;
font-size: 1.7rem;
color: variables.$secondary-color;
max-width: 70vw;
text-align: center;
margin-bottom: 1.5rem;

@media only screen and (max-width: variables.$max-width-tablet) {
font-size: 1.3rem;
}
}

.body {
&_aboutUs {
display: flex;
width: 70vw;

@media only screen and (max-width: variables.$max-width-paragraph) {
display: flex;
flex-direction: column;
}
}

&_contact {
display: flex;
min-width: 100%;
width: 70vw;

@media only screen and (max-width: variables.$max-width-tablet) {
display: flex;
flex-direction: column;
min-width: 70%;
min-height: 100vh;
}
}
}
}
4 changes: 2 additions & 2 deletions components/section/section.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export default function Section ({
}: Props
): ReactElement {
const style: CSSProperties = {
minHeight: minHeight,
marginBottom: marginBottom
minHeight,
marginBottom
}

return (
Expand Down
2 changes: 2 additions & 0 deletions interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ export interface ContactModel {
_id: ObjectID
lang: string
title: string
maintitle: string
subtitle: string
}

export interface FactoryModel {
Expand Down
57 changes: 0 additions & 57 deletions pages/about-us/about-us.module.scss
Original file line number Diff line number Diff line change
@@ -1,57 +0,0 @@
@use "../../global/variables.scss" as variables;

.section {
&_container {
display: flex;
flex-direction: column;
align-items: center;
min-width: 100%;
padding: 2.4rem 0;
}
&_body {
display: flex;
justify-content: space-between;
width: 70vw;
}
}

.h1 {
font-family: "Zaph Humanist", sans-serif;
font-size: 3rem;
text-transform: uppercase;
color: variables.$secondary-color;
margin-bottom: 2.4rem;
}

.h3 {
font-family: "SuisseInt-Regular", sans-serif;
font-size: 1.4rem;
color: variables.$secondary-color;
max-width: 70vw;
text-align: justify;
margin-bottom: 1.5rem;
}

@media only screen and (max-width: variables.$max-width-paragraph) {
.section {
&_body {
display: flex;
flex-direction: column;
}
}

.h3 {
text-align: center;
}
}

@media only screen and (max-width: variables.$max-width-middle) {
.h1 {
font-size: 2.5rem;
}

.h3 {
font-size: 1rem;
}
}
// TODO: ORTALA
24 changes: 9 additions & 15 deletions pages/about-us/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import Section from '../../components/section/section.component'
import ImageBox from '../../components/image-box/image-box.component'
import Paragraph from '../../components/paragraph/paragraph.component'

import styles from './about-us.module.scss'

import { CommonModel, AboutUsModel } from '../../interfaces/index'
import { getData } from '../../utils/dbUtils'
import { getBase64Values } from '../../utils/imageUtils'
import CustomContainer from '../../components/custom-container/custom-container.component'
// import Grid from '../../components/grid/grid.component'

interface Props {
Expand Down Expand Up @@ -64,19 +63,14 @@ export default function AboutUs ({
/>
</Section>
<Section relative>
<div className={styles.section_container}>
<h1 className={styles.h1}>{title}</h1>
<h3 className={styles.h3}>{subtitle}</h3>
<div className={styles.section_body}>
<Paragraph>
{paragraphs[0]}
</Paragraph>
<Paragraph>
{paragraphs[1]}
</Paragraph>
</div>
{/* <Grid/> */}
</div>
<CustomContainer page="about-us" h1={title} h2={subtitle} justifyContent='space-between'>
<Paragraph>
{paragraphs[0]}
</Paragraph>
<Paragraph>
{paragraphs[1]}
</Paragraph>
</CustomContainer>
</Section>
</Layout>
</>
Expand Down
22 changes: 22 additions & 0 deletions pages/contact/contact.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@use "../../global/variables.scss" as variables;

.left {
border: 1px solid green;
flex-basis: 40%;
min-height: 50vh;
display: flex;

@media only screen and (max-width: variables.$max-width-tablet) {
min-height: 40vh;
}
}

.right {
border: 1px solid pink;
flex-basis: 40%;
min-height: 50vh;

@media only screen and (max-width: variables.$max-width-tablet) {
min-height: 40vh;
}
}
20 changes: 16 additions & 4 deletions pages/contact/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import Head from 'next/head'
import Layout from '../../components/layout/layout.component'
import Section from '../../components/section/section.component'
import ImageBox from '../../components/image-box/image-box.component'
import CustomContainer from '../../components/custom-container/custom-container.component'

import styles from './contact.module.scss'

import { CommonModel, ContactModel } from '../../interfaces/index'
import { getBase64Values } from '../../utils/imageUtils'
Expand Down Expand Up @@ -34,7 +37,9 @@ export const getStaticProps: GetStaticProps = async ({ locale = 'tr' }) => {
export default function Contact ({
common,
page: {
title
title,
maintitle,
subtitle
},
Base64Values
}: Props
Expand All @@ -57,9 +62,16 @@ export default function Contact ({
/>
</Section>
<Section relative>
<div style={{ minHeight: '100vh' }}>

</div>
<CustomContainer page='contact' h1={maintitle} h3={subtitle} justifyContent='space-around'>
<div className={styles.left}>
<h4>test</h4>
<p>test</p>
</div>
<div className={styles.right}>
<h4>test</h4>
<p>test</p>
</div>
</CustomContainer>
</Section>
</Layout>
</>
Expand Down