WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 1362b95

Browse files
committed
Add location & change current experience appearance
1 parent 7575ba3 commit 1362b95

File tree

10 files changed

+1546
-88
lines changed

10 files changed

+1546
-88
lines changed

workspaces/gql-types/src/index.ts

Lines changed: 1370 additions & 64 deletions
Large diffs are not rendered by default.

workspaces/landing/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"graphql": "^15.6.1",
4747
"path-browserify": "^1.0.1",
4848
"process": "^0.11.10",
49+
"rc-tooltip": "^5.1.1",
4950
"react": "^17.0.1",
5051
"react-dom": "^17.0.1",
5152
"react-helmet": "^6.1.0",
@@ -59,8 +60,8 @@
5960
"devDependencies": {
6061
"@babel/preset-env": "^7.15.8",
6162
"@babel/preset-react": "^7.14.5",
62-
"@babel/register": "^7.15.3",
6363
"@babel/preset-typescript": "^7.15.0",
64+
"@babel/register": "^7.15.3",
6465
"@types/react-helmet": "^6.1.4",
6566
"@types/react-transition-group": "^4.4.4"
6667
}

workspaces/landing/src/components/atoms/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ export { default as Button } from './button'
2424
export type { ButtonProps, ButtonLinkProps } from './button'
2525
export { default as ScrollToArea } from './scroll-to-area'
2626
export type { Props as ScrollToAreaProps } from './scroll-to-area'
27+
export { default as Tag } from './tag'
28+
export type { Props as TagProps } from './tag'
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { css } from '@emotion/react'
2+
import { ReactNode } from 'react'
3+
import { theme } from '@teimurjan/utils'
4+
import { EmotionProps } from '../../../utils'
5+
6+
export interface Props extends EmotionProps {
7+
children: ReactNode
8+
color: keyof typeof theme.colors.background
9+
}
10+
11+
const Tag = ({ className, children, color }: Props) => {
12+
const textColor = color === 'beige' ? 'blue' : 'beige'
13+
14+
return (
15+
<span
16+
css={css`
17+
background: ${theme.colors.background[color]};
18+
text-transform: uppercase;
19+
font-weight: bold;
20+
font-size: ${theme.typography.text.small.fontSize};
21+
line-height: ${theme.typography.text.small.lineHeight};
22+
padding: ${theme.spacing.xxsmall} ${theme.spacing.xsmall};
23+
color: ${theme.colors.typography[textColor]};
24+
`}
25+
className={className}
26+
>
27+
{children}
28+
</span>
29+
)
30+
}
31+
32+
export default Tag
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { default } from './Tag'
2+
export type { Props } from './Tag'

workspaces/landing/src/components/molecules/card/Card.tsx

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ export interface Props extends EmotionProps {
1111
imageSrc?: string
1212
imageAlt?: string
1313
title: string
14-
subtitle1: string
14+
subtitle1: ReactNode
1515
subtitle2?: string
16-
color?: keyof typeof theme.colors.background
16+
overlay?: ReactNode
1717
}
1818

1919
const Card = forwardRef<HTMLDivElement, Props>(
@@ -27,58 +27,70 @@ const Card = forwardRef<HTMLDivElement, Props>(
2727
imageAlt,
2828
subtitle1,
2929
subtitle2,
30-
color = 'beige',
30+
overlay,
3131
},
3232
ref
3333
) => {
34-
const textColor = color === 'beige' ? 'blue' : 'beige'
35-
3634
return (
3735
<div
3836
id={id}
3937
ref={ref}
4038
css={css`
4139
padding: ${theme.spacing.small} ${theme.spacing.medium};
4240
box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
43-
background: ${theme.colors.background[color]};
41+
background: ${theme.colors.background.beige};
42+
position: relative;
4443
`}
4544
className={className}
4645
>
46+
{overlay && (
47+
<div
48+
css={css`
49+
position: absolute;
50+
right: 0;
51+
top: ${theme.spacing.small};
52+
`}
53+
color="blue"
54+
>
55+
{overlay}
56+
</div>
57+
)}
58+
4759
<Flex alignItemsCenter>
4860
{imageSrc && (
4961
<Flex.Item>
5062
<img
5163
css={css`
5264
max-height: 3.25rem;
53-
margin-right: ${theme.spacing.small};
65+
margin-right: ${theme.spacing.medium};
5466
`}
5567
src={imageSrc}
5668
alt={imageAlt}
5769
/>
5870
</Flex.Item>
5971
)}
6072

61-
<Flex.Item>
62-
<Typography.Title color={textColor} variant="h4">
63-
{title}
64-
</Typography.Title>
73+
<Flex.Item
74+
css={
75+
overlay &&
76+
css`
77+
padding-right: ${theme.spacing.medium};
78+
`
79+
}
80+
>
81+
<Typography.Title variant="h4">{title}</Typography.Title>
6582
<Typography.Title
66-
color={textColor}
6783
css={css`
6884
margin-bottom: ${theme.spacing.xsmall};
6985
`}
7086
variant="h5"
7187
>
7288
{subtitle1}
7389
</Typography.Title>
74-
{subtitle2 && (
75-
<Typography.Text color={textColor}>{subtitle2}</Typography.Text>
76-
)}
90+
{subtitle2 && <Typography.Text>{subtitle2}</Typography.Text>}
7791
</Flex.Item>
7892
</Flex>
79-
<Typography.Text color={textColor} container>
80-
{children}
81-
</Typography.Text>
93+
<Typography.Text container>{children}</Typography.Text>
8294
</div>
8395
)
8496
}

workspaces/landing/src/components/organisms/experience-history/ExperienceHistory.tsx

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import { Fragment } from 'react'
12
import { graphql, useStaticQuery } from 'gatsby'
23
import { css } from '@emotion/react'
34
import { Swiper, SwiperSlide } from 'swiper/react'
45
import SwiperCore, { Pagination } from 'swiper'
56
import { prettyRange, theme } from '@teimurjan/utils'
67
import { ExperienceHistoryQuery } from '@teimurjan/gql-types'
7-
import { RichText, ScrollToArea, Typography } from '../../atoms'
8+
import Tooltip from 'rc-tooltip'
9+
import { RichText, ScrollToArea, Tag, Typography } from '../../atoms'
810
import { Card } from '../../molecules'
911

1012
const query = graphql`
@@ -26,6 +28,8 @@ const query = graphql`
2628
description {
2729
html
2830
}
31+
location
32+
locationIcon
2933
}
3034
}
3135
}
@@ -67,6 +71,9 @@ const ExperienceHistory = () => {
6771
</Typography.Title>
6872

6973
<Swiper
74+
css={css`
75+
margin: 0 -${theme.spacing.small};
76+
`}
7077
pagination={{ clickable: true }}
7178
slidesPerView={1}
7279
spaceBetween={0}
@@ -80,30 +87,48 @@ const ExperienceHistory = () => {
8087
}}
8188
onBreakpoint={handleSwiperBreakpointChange}
8289
>
83-
{experiences.map((experience, index) => {
90+
{experiences.map((experience) => {
8491
return (
8592
<SwiperSlide key={experience.id}>
8693
<Card
8794
css={css`
8895
margin-top: ${theme.spacing.small};
8996
margin-right: ${theme.spacing.small};
97+
margin-left: ${theme.spacing.small};
9098
margin-bottom: ${theme.spacing.xlarge};
9199
92-
height: 475px;
100+
height: 500px;
93101
94102
@media ${theme.screens.medium.mediaUpTo} {
95103
height: 625px;
96104
}
97105
`}
98-
color={index === 0 ? 'blue' : undefined}
99106
imageSrc={experience.logo.url}
100107
imageAlt={experience.company}
101108
title={experience.position}
102-
subtitle1={`at ${experience.company}`}
109+
subtitle1={
110+
<Fragment>
111+
at {experience.company}{' '}
112+
<Tooltip
113+
placement="right"
114+
overlay={<span>{experience.location}</span>}
115+
destroyTooltipOnHide
116+
>
117+
<span
118+
css={css`
119+
cursor: default;
120+
`}
121+
>
122+
{experience.locationIcon}
123+
</span>
124+
</Tooltip>
125+
</Fragment>
126+
}
103127
subtitle2={prettyRange(
104128
experience.startDate,
105129
experience.endDate
106130
)}
131+
overlay={!experience.endDate && <Tag color="blue">Now</Tag>}
107132
>
108133
<RichText html={experience.description.html} />
109134
</Card>

workspaces/landing/src/pages/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'swiper/css'
22
import 'swiper/css/pagination'
3+
import 'rc-tooltip/assets/bootstrap.css'
34
import { Content, Layout } from '../components/atoms'
45
import { Section, GridSection } from '../components/molecules'
56
import {

workspaces/utils/src/theme.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ const theme = {
126126
},
127127
},
128128
spacing: {
129+
xxsmall: '0.25rem',
129130
xsmall: '0.5rem',
130131
small: '1rem',
131132
medium: '2rem',

yarn.lock

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,6 +1098,13 @@
10981098
dependencies:
10991099
regenerator-runtime "^0.13.4"
11001100

1101+
"@babel/runtime@^7.10.1", "@babel/runtime@^7.11.1":
1102+
version "7.16.5"
1103+
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.5.tgz#7f3e34bf8bdbbadf03fbb7b1ea0d929569c9487a"
1104+
integrity sha512-TXWihFIS3Pyv5hzR7j6ihmeLkZfrXGxAr5UfSl8CHf+6q/wpiYDkUau0czckpYG8QmnCIuPpdLtuA9VmuGGyMA==
1105+
dependencies:
1106+
regenerator-runtime "^0.13.4"
1107+
11011108
"@babel/runtime@^7.14.6":
11021109
version "7.16.3"
11031110
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.3.tgz#b86f0db02a04187a3c17caa77de69840165d42d5"
@@ -4756,6 +4763,11 @@ class-utils@^0.3.5:
47564763
isobject "^3.0.0"
47574764
static-extend "^0.1.1"
47584765

4766+
[email protected], classnames@^2.2.1, classnames@^2.2.6:
4767+
version "2.3.1"
4768+
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.1.tgz#dfcfa3891e306ec1dad105d0e88f4417b8535e8e"
4769+
integrity sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA==
4770+
47594771
clean-stack@^2.0.0:
47604772
version "2.2.0"
47614773
resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b"
@@ -5860,6 +5872,11 @@ dom-accessibility-api@^0.5.9:
58605872
resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.10.tgz#caa6d08f60388d0bb4539dd75fe458a9a1d0014c"
58615873
integrity sha512-Xu9mD0UjrJisTmv7lmVSDMagQcU9R5hwAbxsaAE/35XPnPLJobbuREfV/rraiSaEj/UOvgrzQs66zyTWTlyd+g==
58625874

5875+
dom-align@^1.7.0:
5876+
version "1.12.2"
5877+
resolved "https://registry.yarnpkg.com/dom-align/-/dom-align-1.12.2.tgz#0f8164ebd0c9c21b0c790310493cd855892acd4b"
5878+
integrity sha512-pHuazgqrsTFrGU2WLDdXxCFabkdQDx72ddkraZNih1KsMcN5qsRSTR9O4VJRlwTPCPb5COYg3LOfiMHHcPInHg==
5879+
58635880
dom-converter@^0.2.0:
58645881
version "0.2.0"
58655882
resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768"
@@ -12383,6 +12400,55 @@ raw-loader@^4.0.2:
1238312400
loader-utils "^2.0.0"
1238412401
schema-utils "^3.0.0"
1238512402

12403+
rc-align@^4.0.0:
12404+
version "4.0.11"
12405+
resolved "https://registry.yarnpkg.com/rc-align/-/rc-align-4.0.11.tgz#8198c62db266bc1b8ef05e56c13275bf72628a5e"
12406+
integrity sha512-n9mQfIYQbbNTbefyQnRHZPWuTEwG1rY4a9yKlIWHSTbgwI+XUMGRYd0uJ5pE2UbrNX0WvnMBA1zJ3Lrecpra/A==
12407+
dependencies:
12408+
"@babel/runtime" "^7.10.1"
12409+
classnames "2.x"
12410+
dom-align "^1.7.0"
12411+
lodash "^4.17.21"
12412+
rc-util "^5.3.0"
12413+
resize-observer-polyfill "^1.5.1"
12414+
12415+
rc-motion@^2.0.0:
12416+
version "2.4.4"
12417+
resolved "https://registry.yarnpkg.com/rc-motion/-/rc-motion-2.4.4.tgz#e995d5fa24fc93065c24f714857cf2677d655bb0"
12418+
integrity sha512-ms7n1+/TZQBS0Ydd2Q5P4+wJTSOrhIrwNxLXCZpR7Fa3/oac7Yi803HDALc2hLAKaCTQtw9LmQeB58zcwOsqlQ==
12419+
dependencies:
12420+
"@babel/runtime" "^7.11.1"
12421+
classnames "^2.2.1"
12422+
rc-util "^5.2.1"
12423+
12424+
rc-tooltip@^5.1.1:
12425+
version "5.1.1"
12426+
resolved "https://registry.yarnpkg.com/rc-tooltip/-/rc-tooltip-5.1.1.tgz#94178ed162d0252bc4993b725f5dc2ac0fccf154"
12427+
integrity sha512-alt8eGMJulio6+4/uDm7nvV+rJq9bsfxFDCI0ljPdbuoygUscbsMYb6EQgwib/uqsXQUvzk+S7A59uYHmEgmDA==
12428+
dependencies:
12429+
"@babel/runtime" "^7.11.2"
12430+
rc-trigger "^5.0.0"
12431+
12432+
rc-trigger@^5.0.0:
12433+
version "5.2.10"
12434+
resolved "https://registry.yarnpkg.com/rc-trigger/-/rc-trigger-5.2.10.tgz#8a0057a940b1b9027eaa33beec8a6ecd85cce2b1"
12435+
integrity sha512-FkUf4H9BOFDaIwu42fvRycXMAvkttph9AlbCZXssZDVzz2L+QZ0ERvfB/4nX3ZFPh1Zd+uVGr1DEDeXxq4J1TA==
12436+
dependencies:
12437+
"@babel/runtime" "^7.11.2"
12438+
classnames "^2.2.6"
12439+
rc-align "^4.0.0"
12440+
rc-motion "^2.0.0"
12441+
rc-util "^5.5.0"
12442+
12443+
rc-util@^5.2.1, rc-util@^5.3.0, rc-util@^5.5.0:
12444+
version "5.16.1"
12445+
resolved "https://registry.yarnpkg.com/rc-util/-/rc-util-5.16.1.tgz#374db7cb735512f05165ddc3d6b2c61c21b8b4e3"
12446+
integrity sha512-kSCyytvdb3aRxQacS/71ta6c+kBWvM1v8/2h9d/HaNWauc3qB8pLnF20PJ8NajkNN8gb+rR1l0eWO+D4Pz+LLQ==
12447+
dependencies:
12448+
"@babel/runtime" "^7.12.5"
12449+
react-is "^16.12.0"
12450+
shallowequal "^1.1.0"
12451+
1238612452
rc@^1.2.7, rc@^1.2.8:
1238712453
version "1.2.8"
1238812454
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
@@ -12988,6 +13054,11 @@ requires-port@^1.0.0:
1298813054
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
1298913055
integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=
1299013056

13057+
resize-observer-polyfill@^1.5.1:
13058+
version "1.5.1"
13059+
resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464"
13060+
integrity sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==
13061+
1299113062
resolve-alpn@^1.0.0:
1299213063
version "1.2.1"
1299313064
resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9"
@@ -13373,6 +13444,11 @@ shallow-compare@^1.2.2:
1337313444
resolved "https://registry.yarnpkg.com/shallow-compare/-/shallow-compare-1.2.2.tgz#fa4794627bf455a47c4f56881d8a6132d581ffdb"
1337413445
integrity sha512-LUMFi+RppPlrHzbqmFnINTrazo0lPNwhcgzuAXVVcfy/mqPDrQmHAyz5bvV0gDAuRFrk804V0HpQ6u9sZ0tBeg==
1337513446

13447+
shallowequal@^1.1.0:
13448+
version "1.1.0"
13449+
resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8"
13450+
integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==
13451+
1337613452
sharp@^0.29.0:
1337713453
version "0.29.1"
1337813454
resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.29.1.tgz#f60b50f24f399464a24187c86bd2da41aae50b85"

0 commit comments

Comments
 (0)