blob: 01948e9e53a83757b2dd350192d78fe004387bef (
plain)
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
|
import Image from 'next/image';
import Link from 'next/link';
import { ReactElement } from 'react';
import { t } from '@lingui/macro';
import photo from '@assets/images/armand-philippot.jpg';
import { config } from '@config/website';
import styles from './Branding.module.scss';
import Head from 'next/head';
import { Person, WithContext } from 'schema-dts';
import Logo from './Logo/Logo';
type BrandingReturn = ({ isHome }: { isHome: boolean }) => ReactElement;
const Branding: BrandingReturn = ({ isHome = false }) => {
const TitleTag = isHome ? 'h1' : 'p';
const schemaJsonLd: WithContext<Person> = {
'@context': 'https://schema.org',
'@type': 'Person',
'@id': `${config.url}/#branding`,
name: config.name,
url: config.url,
jobTitle: config.baseline,
image: photo.src,
subjectOf: { '@id': `${config.url}` },
};
return (
<>
<Head>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaJsonLd) }}
></script>
</Head>
<div id="branding" className={styles.wrapper}>
<div className={styles.logo}>
<div className={styles.logo__front}>
<Image
src={photo}
alt={t({
message: `${config.name} picture`,
comment: 'Branding logo.',
})}
layout="responsive"
/>
</div>
<div className={styles.logo__back}>
<Logo />
</div>
</div>
<TitleTag className={styles.name}>
<Link href="/">
<a className={styles.link}>{config.name}</a>
</Link>
</TitleTag>
<p className={styles.job}>{config.baseline}</p>
</div>
</>
);
};
export default Branding;
|