Skip to content

Commit

Permalink
Merge pull request #9 from shivjoshi1996/develop
Browse files Browse the repository at this point in the history
V1 Release
  • Loading branch information
shivjoshi1996 authored Dec 1, 2021
2 parents 0191bc9 + ba5e66e commit 3cbec58
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 23 deletions.
2 changes: 2 additions & 0 deletions src/components/ContactForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const StyledContactForm = styled.form`
input[type='text'],
input[type='email'] {
font-family: 'Montserrat', san-serif;
width: 100%;
border: none;
background-color: #fec5bb;
Expand All @@ -58,6 +59,7 @@ const StyledContactForm = styled.form`
background-color: #fec5bb;
border-bottom: 1px solid white;
resize: none;
font-family: 'Montserrat', san-serif;
font-size: 1rem;
color: #2f2e41;
}
Expand Down
41 changes: 25 additions & 16 deletions src/components/HomeServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ const StyledServicesDescription = styled.p`

const StyledServicesGrid = styled.div`
display: grid;
grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
grid-template-columns: 1fr;
grid-gap: 5rem;
@media (min-width: 768px) {
grid-template-columns: 1fr 1fr;
}
`;

const StyledServiceItem = styled.div`
Expand All @@ -32,7 +36,7 @@ const StyledServiceItem = styled.div`
margin-bottom: 0.5rem;
}
p {
max-width: 25rem;
width: 100%;
}
`;

Expand All @@ -52,27 +56,32 @@ export default function HomeServices({
servicesTitle,
servicesDescription,
}) {
const servicesArray = services.nodes;
return (
<StyledServicesSection id="services">
<StyledServicesHeading>{servicesTitle}</StyledServicesHeading>
<StyledServicesDescription>
{servicesDescription}
</StyledServicesDescription>
<StyledServicesGrid>
{servicesArray.map((service) => (
<StyledServiceItem key={service.serviceTitle}>
<StyledServiceImageWrapper key={service.serviceTitle}>
<img
src={
service.serviceImage.asset.gatsbyImageData.images.fallback.src
}
/>
</StyledServiceImageWrapper>
<h3>{service.serviceTitle}</h3>
<p>{service.serviceDescription}</p>
</StyledServiceItem>
))}
{services.length > 0
? services.map((service) => (
<StyledServiceItem key={service.serviceTitle}>
<StyledServiceImageWrapper key={service.serviceTitle}>
{service.serviceImage ? (
<img
src={
service.serviceImage.asset.gatsbyImageData.images
.fallback.src
}
alt=""
/>
) : null}
</StyledServiceImageWrapper>
<h3>{service.serviceTitle}</h3>
<p>{service.serviceDescription}</p>
</StyledServiceItem>
))
: null}
</StyledServicesGrid>
</StyledServicesSection>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const StyledLogo = styled.a`
font-weight: 600;
@media (min-width: 768px) {
font-size: 1.7rem;
font-size: 2rem;
}
`;

Expand Down
8 changes: 2 additions & 6 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import SEO from '../components/SEO';

export default function IndexPage({ data }) {
const { sanityHomepage } = data;
const { allSanityHomepageServices } = data;
return (
<div>
<SEO />
Expand All @@ -18,7 +17,7 @@ export default function IndexPage({ data }) {
heroButtonText={sanityHomepage.heroButtonText}
/>
<HomeServices
services={allSanityHomepageServices}
services={sanityHomepage.services}
servicesTitle={sanityHomepage.servicesTitle}
servicesDescription={sanityHomepage.servicesDescription}
/>
Expand Down Expand Up @@ -48,14 +47,11 @@ export const query = graphql`
whoWeAreDescription
contactFormTitle
contactFormDescription
}
allSanityHomepageServices {
nodes {
services {
serviceTitle
serviceDescription
serviceImage {
asset {
id
gatsbyImageData
}
}
Expand Down

0 comments on commit 3cbec58

Please sign in to comment.