Skip to content

Commit 15a6584

Browse files
committed
feat: 💥 migration twitter-x DSFR v1.11.0
1 parent 76cc3dc commit 15a6584

File tree

8 files changed

+58
-35
lines changed

8 files changed

+58
-35
lines changed

src/components/DsfrFollow/DsfrFollow.e2e.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,28 @@ describe('DsfrFollow', () => {
66
it('should mount DsfrFollow', () => {
77
const networks = [
88
{
9-
name: 'facebook',
9+
name: 'Facebook',
10+
type: 'facebook',
1011
href: 'https://www.facebook.com',
1112
},
1213
{
13-
name: 'twitter',
14+
name: 'X (anciennement Twitter)',
15+
type: 'twitter-x',
1416
href: 'https://www.twitter.com',
1517
},
1618
{
17-
name: 'youtube',
19+
name: 'Youtube',
20+
type: 'youtube',
1821
href: 'https://www.youtube.com',
1922
},
2023
{
21-
name: 'linkedin',
24+
name: 'Linkedin',
25+
type: 'linkedin',
2226
href: 'https://www.linkedin.com',
2327
},
2428
{
25-
name: 'instagram',
29+
name: 'Instagram',
30+
type: 'instagram',
2631
href: 'https://www.instagram.com',
2732
},
2833
]

src/components/DsfrFollow/DsfrFollow.stories.ts

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default {
1111
argTypes: {
1212
networks: {
1313
control: 'object',
14-
description: 'Liste des différents réseaux sociaux ; doit avoir 2 props : `name` (forcément parmi les valeurs suivantes : `\'facebook\'`, `\'twitter\'`, `\'youtube\'`, `\'linkedin\'`, `\'instagram\'`) et `url`',
14+
description: 'Liste des différents réseaux sociaux ; doit avoir 3 props : `name`, `type` (forcément parmi les valeurs suivantes : `\'facebook\'`, `\'twitter-x\'`, `\'youtube\'`, `\'linkedin\'`, `\'instagram\'`) et `href`',
1515
},
1616
newsletterData: {
1717
control: 'object',
@@ -38,23 +38,28 @@ export const Suivre = (args) => ({
3838
Suivre.args = {
3939
networks: [
4040
{
41-
name: 'facebook',
41+
name: 'Facebook',
42+
type: 'facebook',
4243
href: 'https://www.facebook.com',
4344
},
4445
{
45-
name: 'twitter',
46-
href: 'https://www.twitter.com',
46+
name: 'X (anciennement Twitter)',
47+
type: 'twitter-x',
48+
href: 'https://www.x.com',
4749
},
4850
{
49-
name: 'youtube',
51+
name: 'Youtube',
52+
type: 'youtube',
5053
href: 'https://www.youtube.com',
5154
},
5255
{
53-
name: 'linkedin',
56+
name: 'Linkedin',
57+
type: 'linkedin',
5458
href: 'https://www.linkedin.com',
5559
},
5660
{
57-
name: 'instagram',
61+
name: 'Instagram',
62+
type: 'instagram',
5863
href: 'https://www.instagram.com',
5964
},
6065
],
@@ -90,23 +95,28 @@ export const SuivreMiseEnAvant = (args) => ({
9095
SuivreMiseEnAvant.args = {
9196
networks: [
9297
{
93-
name: 'facebook',
98+
name: 'Facebook',
99+
type: 'facebook',
94100
href: 'https://www.facebook.com',
95101
},
96102
{
97-
name: 'twitter',
98-
href: 'https://www.twitter.com',
103+
name: 'X (anciennement Twitter)',
104+
type: 'twitter-x',
105+
href: 'https://www.x.com',
99106
},
100107
{
101-
name: 'youtube',
108+
name: 'Youtube',
109+
type: 'youtube',
102110
href: 'https://www.youtube.com',
103111
},
104112
{
105-
name: 'linkedin',
113+
name: 'Linkedin',
114+
type: 'linkedin',
106115
href: 'https://www.linkedin.com',
107116
},
108117
{
109-
name: 'instagram',
118+
name: 'Instagram',
119+
type: 'instagram',
110120
href: 'https://www.instagram.com',
111121
},
112122
],

src/components/DsfrFollow/DsfrFollow.types.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
export type DsfrSocialNetworkName = 'facebook' | 'twitter' | 'instagram' | 'linkedin' | 'youtube'
1+
export type DsfrSocialNetworkName = 'facebook' | 'twitter-x' | 'instagram' | 'linkedin' | 'youtube'
22
export type DsfrSocialNetwork = {
3-
name: DsfrSocialNetworkName,
3+
type: DsfrSocialNetworkName,
4+
name: string,
45
href: string
56
}
67

src/components/DsfrFollow/DsfrSocialNetworks.spec.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ describe('DsfrSocialNetworks', () => {
88
// Given
99
const networks = [
1010
{
11-
name: 'facebook',
11+
name: 'Facebook',
12+
type: 'facebook',
1213
href: 'https://www.facebook.com',
1314
},
1415
{
15-
name: 'twitter',
16+
name: 'X (anciennement Twitter)',
17+
type: 'twitter-x',
1618
href: 'https://www.twitter.com',
1719
},
1820
]
@@ -30,7 +32,7 @@ describe('DsfrSocialNetworks', () => {
3032
})
3133
const liElts = container.querySelectorAll('.fr-btn')
3234
const facebookIcon = container.querySelector('.fr-btn--facebook')
33-
const twitterIcon = container.querySelector('.fr-btn--twitter')
35+
const twitterIcon = container.querySelector('.fr-btn--twitter-x')
3436

3537
// Then
3638
expect(liElts).toHaveLength(2)

src/components/DsfrFollow/DsfrSocialNetworks.stories.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default {
1111
argTypes: {
1212
networks: {
1313
control: 'object',
14-
description: 'Liste des différents réseaux sociaux ; doit avoir 2 props : `name` (forcément parmi les valeurs suivantes : `\'facebook\'`, `\'twitter\'`, `\'youtube\'`, `\'linkedin\'`, `\'instagram\'`) et `url`',
14+
description: 'Liste des différents réseaux sociaux ; doit avoir 3 props : `name`, `type` (forcément parmi les valeurs suivantes : `\'facebook\'`, `\'twitter-x\'`, `\'youtube\'`, `\'linkedin\'`, `\'instagram\'`) et `url`',
1515
},
1616
titleTag: {
1717
control: 'text',
@@ -43,23 +43,28 @@ ReseauxSociaux.args = {
4343
titleTag: undefined,
4444
networks: [
4545
{
46-
name: 'facebook',
46+
name: 'Facebook',
47+
type: 'facebook',
4748
href: 'https://www.facebook.com',
4849
},
4950
{
50-
name: 'twitter',
51-
href: 'https://www.twitter.com',
51+
name: 'X (anciennement Twitter)',
52+
type: 'twitter-x',
53+
href: 'https://www.x.com',
5254
},
5355
{
54-
name: 'youtube',
56+
name: 'Youtube',
57+
type: 'youtube',
5558
href: 'https://www.youtube.com',
5659
},
5760
{
58-
name: 'linkedin',
61+
name: 'Linkedin',
62+
type: 'linkedin',
5963
href: 'https://www.linkedin.com',
6064
},
6165
{
62-
name: 'instagram',
66+
name: 'Instagram',
67+
type: 'instagram',
6368
href: 'https://www.instagram.com',
6469
},
6570
],

src/components/DsfrFollow/DsfrSocialNetworks.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ withDefaults(defineProps<DsfrSocialNetworksProps>(), {
2828
>
2929
<a
3030
class="fr-btn"
31-
:class="`fr-btn--${network.name}`"
31+
:class="`fr-btn--${network.type}`"
3232
:title="network.name"
3333
:href="network.href"
3434
target="_blank"

src/components/DsfrShare/DsfrShare.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ describe('DsfrShare', () => {
1717
url: 'https://www.facebook.com/sharer.php?u=[À MODIFIER - url de la page]',
1818
},
1919
{
20-
name: 'twitter',
21-
label: 'Partager sur Twitter',
20+
name: 'twitter-x',
21+
label: 'Partager sur X (anciennement Twitter)',
2222
url: 'https://twitter.com/intent/tweet?url=[À MODIFIER - url de la page]&text=[À MODIFIER - titre ou texte descriptif de la page]&via=[À MODIFIER - via]&hashtags=[À MODIFIER - hashtags]',
2323
},
2424
{

src/components/DsfrShare/DsfrShare.stories.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ Partage.args = {
5959
url: 'https://www.facebook.com/sharer.php?u=[À MODIFIER - url de la page]',
6060
},
6161
{
62-
name: 'twitter',
63-
label: 'Partager sur Twitter',
62+
name: 'twitter-x',
63+
label: 'Partager sur X (anciennement Twitter)',
6464
url: 'https://twitter.com/intent/tweet?url=[À MODIFIER - url de la page]&text=[À MODIFIER - titre ou texte descriptif de la page]&via=[À MODIFIER - via]&hashtags=[À MODIFIER - hashtags]',
6565
},
6666
{

0 commit comments

Comments
 (0)