Skip to content

Commit

Permalink
Fetch experience from Google cloud Firestore
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemolenda committed Apr 24, 2020
1 parent 6a1023d commit b80bee1
Show file tree
Hide file tree
Showing 17 changed files with 4,532 additions and 220 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
.next/
apiConfig.json
keys/**.json
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"printWidth": 80,
"printWidth": 100,
"tabWidth": 4,
"singleQuote": true,
"trailingComma": "none",
Expand Down
29 changes: 7 additions & 22 deletions components/experience/experience-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,14 @@ import { Box, ImageBox, H3, H4, LI, SubheadingSmall, UL } from '../common';
import theme from '../common/theme';

export const ExperienceCard = (props) => {
const {
company,
details,
endDate,
fallback,
location,
logo,
title,
startDate
} = props;
const { company, details, endDate, location, logo, title, startDate } = props;

return (
<Box width={{ _: 1, md: 1 / 2, lg: 1 / 3 }} mb={40}>
<ImageBox
src={logo}
fallback={fallback}
alt={company}
src={logo?.src}
fallback={`images/${logo?.filename}`}
alt={logo.alt || ''}
width={200}
height={200}
borderRadius={'25%'}
Expand All @@ -28,12 +19,7 @@ export const ExperienceCard = (props) => {
<H3 textAlign="center" mt={0} mb="10px">
{company}
</H3>
<H4
textAlign="center"
mt={0}
mb="10px"
fw={theme.fontWeights.light}
>
<H4 textAlign="center" mt={0} mb="10px" fw={theme.fontWeights.light}>
{title}
</H4>
<SubheadingSmall
Expand All @@ -43,13 +29,12 @@ export const ExperienceCard = (props) => {
fw={theme.fontWeights.ultraLight}
color={theme.colors.medGray}
>
{startDate.years} -{' '}
{endDate.years < 9999 ? endDate.years : 'Present'}
{startDate.years} - {endDate?.years || 'Present'}
</SubheadingSmall>
<UL mb={0}>
{details.map((detail, i) => (
<LI key={i} mb="20px" hyphens="auto">
{detail}
{detail.text}
</LI>
))}
</UL>
Expand Down
3 changes: 2 additions & 1 deletion components/experience/experience-section.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { Flex } from '../common';
import { SectionLayout } from '../layout';
import { ExperienceCard } from './experience-card';

export const ExperienceSection = props => (
export const ExperienceSection = (props) => (
// TODO get data from context? Does that work with Next static build?
<SectionLayout title="// Where I've Worked">
<Flex flexWrap="wrap" justifyContent="center">
{props.experience.map((exp, i) => (
Expand Down
8 changes: 8 additions & 0 deletions config/jest/cssTransform.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
process() {
return 'module.exports = {};';
},
getCacheKey() {
return 'cssTransform';
}
};
19 changes: 19 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
collectCoverageFrom: [
'**/*.{js,jsx,ts,tsx}',
'!**/*.d.ts',
'!**/node_modules/**'
],
testPathIgnorePatterns: ['/node_modules/', '/.next/'],
transform: {
'^.+\\.(js|jsx|ts|tsx)$': '<rootDir>/node_modules/babel-jest',
'^.+\\.css$': '<rootDir>/config/jest/cssTransform.js'
},
transformIgnorePatterns: [
'/node_modules/',
'^.+\\.module\\.(css|sass|scss)$'
],
moduleNameMapper: {
'^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy'
}
};
3 changes: 3 additions & 0 deletions keys/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# KEYS

Place JSON keys obtained from https://console.cloud.google.com/iam-admin/serviceaccounts here

0 comments on commit b80bee1

Please sign in to comment.