-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathfooter.js
More file actions
255 lines (246 loc) · 9.38 KB
/
Copy pathfooter.js
File metadata and controls
255 lines (246 loc) · 9.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
import React from 'react';
import preval from 'preval.macro';
import moment from 'moment';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faHeart } from '@fortawesome/free-solid-svg-icons';
import GitHubButton from 'react-github-btn';
import {
faFacebook,
faInstagram,
faLinkedin,
faTwitter,
faTiktok,
faYoutube,
} from '@fortawesome/free-brands-svg-icons';
import China from '../../images/china.png';
const buildTimestamp = preval`module.exports = new Date().getTime();`;
const commitHash = process.env.COMMIT_HASH;
const lastUpdatedTooltip = `Last updated ${moment(buildTimestamp)
.utc()
.format('D MMM YYYY [at] HH:mm UTC')}`;
const deploymentTooltipId = 'deployment-tooltip';
const Footer = () => {
return (
<>
<div className="p-4 text-center bg-grey-translucent text-sm">
<section className="main-container flex items-center justify-center gap-2 flex-wrap">
<span>
We <FontAwesomeIcon icon={faHeart} className="text-ssw-red" /> open
source.
</span>
<span>
Loving SSW People?{' '}
<a
href="https://github.com/SSWConsulting/SSW.People"
target="_blank"
rel="noreferrer"
className="action-button-label footer-greybar-link"
>
Star us on GitHub.
</a>{' '}
</span>
<GitHubButton
href="https://github.com/SSWConsulting/SSW.People"
data-size="large"
data-show-count="true"
aria-label="Star SSWConsulting/SSW.People on GitHub"
>
Star
</GitHubButton>
</section>
<section className="main-container flex items-center justify-center mt-4">
<span>
Stand by... we're migrating this site to{' '}
<a
className="action-button-label footer-greybar-link"
href="https://tina.io"
>
TinaCMS
</a>.
</span>
</section>
</div>
<footer className="bg-black text-center px-4 py-6 md:py-4 lg:py-2">
<section className="main-container">
<div className="xl:mx-6">
<div className="mx-6 flex flex-col-reverse md:flex-row justify-between align-middle leading-6">
<div className="py-2">
© 1990-{new Date().getFullYear()} SSW. All rights reserved.
</div>
<div className="w-full md:w-3/4 md:text-right py-2">
<a
className="footer-link"
href="https://github.com/SSWConsulting/SSW.People/issues"
>
FEEDBACK / SUGGEST A FEATURE
</a>
<span className="px-2">|</span>
<a
className="footer-link"
href="https://www.ssw.com.au/terms-and-conditions"
>
TERMS AND CONDITIONS
</a>
<span className="px-2">|</span>
<div className="inline-flex flex-row-reverse justify-end flex-nowrap">
<a
className="unstyled social-media-icon"
title="SSW on TikTok"
href="https://www.tiktok.com/@ssw_tv"
target="_blank"
rel="noreferrer"
aria-label="SSW on TikTok"
>
<FontAwesomeIcon icon={faTiktok} size="lg" />
</a>
<a
className="unstyled social-media-icon"
title="SSW on X (Twitter)"
href="https://x.com/SSW_TV"
target="_blank"
rel="noreferrer"
aria-label="SSW on X (Twitter)"
>
<FontAwesomeIcon icon={faTwitter} size="lg" />
</a>
<a
className="unstyled social-media-icon"
title="SSW on Instagram"
href="https://www.instagram.com/ssw_tv"
target="_blank"
rel="noreferrer"
aria-label="SSW on Instagram"
>
<FontAwesomeIcon icon={faInstagram} size="lg" />
</a>
<a
className="unstyled social-media-icon"
title="SSW on Facebook"
href="https://www.facebook.com/SSW.page"
target="_blank"
rel="noreferrer"
aria-label="SSW on Facebook"
>
<FontAwesomeIcon icon={faFacebook} size="lg" />
</a>
<a
className="unstyled social-media-icon"
title="SSW on LinkedIn"
href="https://www.linkedin.com/company/ssw/"
target="_blank"
rel="noreferrer"
aria-label="SSW on LinkedIn"
>
<FontAwesomeIcon icon={faLinkedin} size="lg" />
</a>
<a
className="unstyled social-media-icon"
title="SSW on YouTube"
href="https://www.youtube.com/user/sswtechtalks/"
target="_blank"
rel="noreferrer"
aria-label="SSW on YouTube"
>
<FontAwesomeIcon icon={faYoutube} size="lg" />
</a>
</div>
</div>
{/* © 1990-{new Date().getFullYear()} SSW. All rights reserved. */}
</div>
<hr className="border-gray-800 my-2"></hr>
<div className="flex flex-col lg:flex-row justify-between mx-2 md:mx-6">
<div className="py-2">
This website is under{' '}
<a
className="text-white hover:text-ssw-red focus-visible:text-ssw-red transition-colors"
style={{ textDecoration: 'none' }}
href="https://www.ssw.com.au/rules/rules-to-better-websites-deployment"
>
continuous deployment
</a>
. Last updated{' '}
<span
className="group relative inline-block cursor-help text-white hover:text-ssw-red focus-visible:text-ssw-red transition-colors"
tabIndex={0}
aria-describedby={deploymentTooltipId}
title={lastUpdatedTooltip}
>
{getLastDeployTime()} ago
<span
id={deploymentTooltipId}
role="tooltip"
className="absolute left-1/2 -translate-x-1/2 bottom-full mb-1 px-2 py-1 bg-white text-gray-900 text-xs leading-none rounded whitespace-nowrap opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 pointer-events-none transition-opacity duration-150 shadow-md z-10"
>
{lastUpdatedTooltip}
</span>
</span>
{commitHash && (
<>
. Last commit{' '}
<a
className="text-white hover:text-ssw-red focus-visible:text-ssw-red transition-colors"
style={{ textDecoration: 'none' }}
href={`https://github.com/SSWConsulting/SSW.People/commit/${commitHash}`}
target="_blank"
rel="noopener noreferrer nofollow"
>
{commitHash.slice(0, 7)}
</a>
</>
)}
</div>
<div className="py-2">
<a
className="footer-link"
href="https://www.ssw.com.au/rules/rules-to-better-internationalization"
>
Chinafied
<img
src={China}
alt="Chinese flag"
className="flag inline px-1"
/>
</a>
<span className="px-2">|</span>
Powered by{' '}
<a
className="footer-link"
href="https://www.ssw.com.au/rules/rules-to-better-azure"
>
Azure
</a>{' '}
and{' '}
<a
className="footer-link"
href="https://www.ssw.com.au/rules/rules-to-better-github"
>
{' '}
GitHub
</a>
</div>
</div>
</div>
</section>
</footer>
</>
);
};
const getLastDeployTime = () => {
const lastDeployDuration = moment.duration(Date.now() - buildTimestamp);
let delta = Math.abs(lastDeployDuration) / 1000;
const days = Math.floor(delta / 86400);
delta -= days * 86400;
var hours = Math.floor(delta / 3600) % 24;
delta -= hours * 3600;
var minutes = Math.floor(delta / 60) % 60;
delta -= minutes * 60;
return days !== 0
? `${days} day${days > 1 ? 's' : ''}`
: hours !== 0
? `${hours} hour${hours > 1 ? 's' : ''}`
: minutes > 1
? `${minutes} min`
: '1 min';
};
Footer.propTypes = {};
export default Footer;