Skip to content

Commit b4fde6b

Browse files
authored
Merge pull request #1636 from dxc-technology/rarrojolopez-footer
Remove deprecated `padding` prop from the Footer component
2 parents da4b2be + 2cdd97f commit b4fde6b

File tree

5 files changed

+83
-254
lines changed

5 files changed

+83
-254
lines changed

lib/src/footer/Footer.stories.tsx

Lines changed: 1 addition & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -91,78 +91,7 @@ const opinionatedTheme = {
9191
baseColor: "#000000",
9292
fontColor: "#ffffff",
9393
accentColor: "#0095ff",
94-
logo: (
95-
<svg id="g10" xmlns="http://www.w3.org/2000/svg" width="280.781" height="32" viewBox="0 0 280.781 32">
96-
<g id="g12">
97-
<path
98-
id="path14"
99-
d="M171.5-54.124v12.539h-3.6V-54.124h-4.973v-3.191h13.54v3.191H171.5"
100-
transform="translate(-68.528 65.45)"
101-
fill="#fff"
102-
/>
103-
<path
104-
id="path16"
105-
d="M189.96-41.585V-57.315h12.326v3.079h-8.753v3.191h7.7v3.078h-7.7v3.3h8.87v3.078H189.96"
106-
transform="translate(-77.56 65.45)"
107-
fill="#fff"
108-
/>
109-
<path
110-
id="path18"
111-
d="M223.558-41.438a8.1,8.1,0,0,1-8.382-8.1v-.045a8.161,8.161,0,0,1,8.522-8.146,8.6,8.6,0,0,1,6.444,2.431l-2.289,2.543a6.133,6.133,0,0,0-4.178-1.778,4.743,4.743,0,0,0-4.738,4.905v.045a4.752,4.752,0,0,0,4.738,4.95,6,6,0,0,0,4.295-1.845l2.288,2.228a8.491,8.491,0,0,1-6.7,2.813"
112-
transform="translate(-86.019 65.583)"
113-
fill="#fff"
114-
/>
115-
<path
116-
id="path20"
117-
d="M254.988-41.585V-47.9h-6.63v6.315h-3.6V-57.315h3.6v6.225h6.63v-6.225h3.594v15.731h-3.594"
118-
transform="translate(-95.903 65.45)"
119-
fill="#fff"
120-
/>
121-
<path
122-
id="path22"
123-
d="M285.991-41.585l-7.914-10v10h-3.549V-57.315h3.316l7.657,9.685v-9.685h3.549v15.731h-3.058"
124-
transform="translate(-105.869 65.45)"
125-
fill="#fff"
126-
/>
127-
<path
128-
id="path24"
129-
d="M317.2-49.583a4.869,4.869,0,0,0-4.949-4.95,4.793,4.793,0,0,0-4.9,4.905v.045a4.869,4.869,0,0,0,4.949,4.95,4.793,4.793,0,0,0,4.9-4.905Zm-4.949,8.145c-5.043,0-8.661-3.623-8.661-8.1v-.045c0-4.478,3.666-8.146,8.708-8.146s8.66,3.623,8.66,8.1v.045c0,4.477-3.664,8.145-8.708,8.145"
130-
transform="translate(-115.631 65.583)"
131-
fill="#fff"
132-
/>
133-
<path
134-
id="path26"
135-
d="M336.786-41.585V-57.315h3.6v12.584h8.148v3.146H336.786"
136-
transform="translate(-126.654 65.45)"
137-
fill="#fff"
138-
/>
139-
<path
140-
id="path28"
141-
d="M372.78-49.583a4.87,4.87,0,0,0-4.949-4.95,4.794,4.794,0,0,0-4.9,4.905v.045a4.869,4.869,0,0,0,4.949,4.95,4.794,4.794,0,0,0,4.9-4.905Zm-4.949,8.145c-5.043,0-8.662-3.623-8.662-8.1v-.045c0-4.478,3.666-8.146,8.708-8.146s8.661,3.623,8.661,8.1v.045c0,4.477-3.666,8.145-8.708,8.145"
142-
transform="translate(-135.016 65.583)"
143-
fill="#fff"
144-
/>
145-
<path
146-
id="path30"
147-
d="M399.735-41.438c-5.09,0-8.592-3.443-8.592-8.1v-.045a8.243,8.243,0,0,1,8.568-8.146,9.18,9.18,0,0,1,6.42,2.16l-2.265,2.634a6.141,6.141,0,0,0-4.272-1.6,4.807,4.807,0,0,0-4.692,4.905v.045a4.8,4.8,0,0,0,4.949,4.995,5.89,5.89,0,0,0,3.384-.945v-2.25h-3.618v-2.992h7.1v6.841a10.837,10.837,0,0,1-6.98,2.5"
148-
transform="translate(-145.284 65.583)"
149-
fill="#fff"
150-
/>
151-
<path
152-
id="path32"
153-
d="M428.664-47.855v6.27h-3.6v-6.2l-6.28-9.528h4.2L426.89-51l3.968-6.315h4.085l-6.28,9.46"
154-
transform="translate(-154.162 65.45)"
155-
fill="#fff"
156-
/>
157-
<path
158-
id="path34"
159-
d="M84.218-55.737a10.063,10.063,0,0,1,2.589-4.4,9.792,9.792,0,0,1,6.985-2.77h11.328V-69.3H93.792a17.041,17.041,0,0,0-11.8,4.759,16.344,16.344,0,0,0-3.547,5.115,13.247,13.247,0,0,0-1.122,3.688Zm0,4.877a10.065,10.065,0,0,0,2.589,4.4,9.793,9.793,0,0,0,6.985,2.77h11.328V-37.3H93.792a17.042,17.042,0,0,1-11.8-4.759,16.339,16.339,0,0,1-3.547-5.114,13.251,13.251,0,0,1-1.122-3.688ZM63.1-47.98,54.45-37.3H45.873l12.957-16-12.957-16H54.45L63.1-58.619l8.65-10.68h8.578l-12.957,16,12.957,16H71.749ZM48.875-55.737a13.212,13.212,0,0,0-1.122-3.688,16.359,16.359,0,0,0-3.546-5.115,17.043,17.043,0,0,0-11.8-4.759H21.08v6.393H32.408a9.79,9.79,0,0,1,6.985,2.77,10.072,10.072,0,0,1,2.59,4.4Zm0,4.877a13.215,13.215,0,0,1-1.122,3.688,16.353,16.353,0,0,1-3.546,5.114,17.044,17.044,0,0,1-11.8,4.759H21.08v-6.393H32.408a9.791,9.791,0,0,0,6.985-2.77,10.074,10.074,0,0,0,2.59-4.4h6.892"
160-
transform="translate(-21.08 69.298)"
161-
fill="#fff"
162-
/>
163-
</g>
164-
</svg>
165-
),
94+
logo: "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b8/2021_Facebook_icon.svg/2048px-2021_Facebook_icon.svg.png",
16695
},
16796
};
16897

@@ -197,23 +126,6 @@ export const Chromatic = () => (
197126
<Title title="Xxlarge margin" theme="light" level={4} />
198127
<DxcFooter margin="xxlarge"></DxcFooter>
199128
</ExampleContainer>
200-
<Title title="Padding" theme="light" level={2} />
201-
<ExampleContainer>
202-
<Title title="Xxsmall padding" theme="light" level={4} />
203-
<DxcFooter padding="xxsmall"></DxcFooter>
204-
<Title title="Xsmall padding" theme="light" level={4} />
205-
<DxcFooter padding="xsmall"></DxcFooter>
206-
<Title title="Small padding" theme="light" level={4} />
207-
<DxcFooter padding="small"></DxcFooter>
208-
<Title title="Medium padding" theme="light" level={4} />
209-
<DxcFooter padding="medium"></DxcFooter>
210-
<Title title="Large padding" theme="light" level={4} />
211-
<DxcFooter padding="large"></DxcFooter>
212-
<Title title="Xlarge padding" theme="light" level={4} />
213-
<DxcFooter padding="xlarge"></DxcFooter>
214-
<Title title="Xxlarge padding" theme="light" level={4} />
215-
<DxcFooter padding="xxlarge"></DxcFooter>
216-
</ExampleContainer>
217129
<Title title="Opinionated theme" theme="light" level={2} />
218130
<ExampleContainer>
219131
<HalstackProvider theme={opinionatedTheme}>

lib/src/footer/Footer.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const DxcFooter = ({
1212
bottomLinks,
1313
copyright,
1414
children,
15-
padding,
1615
margin,
1716
tabIndex = 0,
1817
}: FooterPropsType): JSX.Element => {
@@ -59,7 +58,7 @@ const DxcFooter = ({
5958
<SocialLinkContainer>{socialLink}</SocialLinkContainer>
6059
</FooterHeader>
6160
<div>
62-
<ChildComponents padding={padding}>
61+
<ChildComponents>
6362
<BackgroundColorProvider color={colorsTheme.footer.backgroundColor}>{children}</BackgroundColorProvider>
6463
</ChildComponents>
6564
<FooterFooter className="footerFooter">
@@ -137,17 +136,8 @@ const BottomLinks = styled.div`
137136
align-self: center;
138137
`;
139138

140-
const ChildComponents = styled.div<{ padding: FooterPropsType["padding"] }>`
139+
const ChildComponents = styled.div`
141140
min-height: 16px;
142-
padding: ${(props) => (props.padding && typeof props.padding !== "object" ? spaces[props.padding] : "0px")};
143-
padding-top: ${(props) =>
144-
props.padding && typeof props.padding === "object" && props.padding.top ? spaces[props.padding.top] : ""};
145-
padding-right: ${(props) =>
146-
props.padding && typeof props.padding === "object" && props.padding.right ? spaces[props.padding.right] : ""};
147-
padding-bottom: ${(props) =>
148-
props.padding && typeof props.padding === "object" && props.padding.bottom ? spaces[props.padding.bottom] : ""};
149-
padding-left: ${(props) =>
150-
props.padding && typeof props.padding === "object" && props.padding.left ? spaces[props.padding.left] : ""};
151141
overflow: hidden;
152142
`;
153143

lib/src/footer/types.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,6 @@ type FooterPropsType = {
5757
* Size of the top margin to be applied to the footer.
5858
*/
5959
margin?: Space | Size;
60-
/**
61-
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
62-
* Size of the padding to be applied to the custom area of the component.
63-
* You can pass an object with properties in order to specify different padding sizes.
64-
*/
65-
padding?: Space | Size;
6660
};
6761

6862
export default FooterPropsType;

website/screens/components/footer/code/FooterCodePage.tsx

Lines changed: 80 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,125 +1,97 @@
11
import {
2-
DxcAlert,
32
DxcFlex,
4-
DxcLink,
53
DxcTable,
64
} from "@dxc-technology/halstack-react";
75
import QuickNavContainer from "@/common/QuickNavContainer";
86
import QuickNavContainerLayout from "@/common/QuickNavContainerLayout";
97
import DocFooter from "@/common/DocFooter";
108
import Code from "@/common/Code";
119
import HeaderDescriptionCell from "@/common/HeaderDescriptionCell";
12-
import StatusTag from "@/common/StatusTag";
13-
import Link from "next/link";
1410

1511
const sections = [
1612
{
1713
title: "Props",
1814
content: (
19-
<>
20-
<DxcAlert type="warning" size="fillParent">
21-
The <Code>padding</Code> prop has been deprecated. Consider using
22-
layout components like the{" "}
23-
<Link href="/components/inset/" passHref>
24-
<DxcLink>Inset</DxcLink>
25-
</Link>{" "}
26-
for the same purpose.
27-
</DxcAlert>
28-
<DxcTable>
29-
<thead>
30-
<tr>
31-
<th>Name</th>
32-
<th>Default</th>
33-
<HeaderDescriptionCell>Description</HeaderDescriptionCell>
34-
</tr>
35-
</thead>
36-
<tbody>
37-
<tr>
38-
<td>socialLinks: object[]</td>
39-
<td>
40-
<Code>[]</Code>
41-
</td>
42-
<td>
43-
An array of objects representing the links that will be rendered
44-
as icons at the top-right side of the footer. Each object has
45-
the following properties:
46-
<ul>
47-
<li>
48-
<b>logo</b>: Element or path used as the icon for the link.
49-
</li>
50-
<li>
51-
<b>href</b>: URL of the page the link goes to.
52-
</li>
53-
</ul>
54-
</td>
55-
</tr>
56-
<tr>
57-
<td>bottomLinks: object[]</td>
58-
<td>
59-
<Code>[]</Code>
60-
</td>
61-
<td>
62-
An array of objects representing the links that will be rendered
63-
at the bottom part of the footer. Each object has the following
64-
properties:
65-
<ul>
66-
<li>
67-
<b>text</b>: Text for the link.
68-
</li>
69-
<li>
70-
<b>href</b>: URL of the page the link goes to.
71-
</li>
72-
</ul>
73-
</td>
74-
</tr>
75-
<tr>
76-
<td>copyright: string</td>
77-
<td></td>
78-
<td>The text that will be displayed as copyright disclaimer.</td>
79-
</tr>
80-
<tr>
81-
<td>children: node</td>
82-
<td></td>
83-
<td>
84-
The center section of the footer. Can be used to render custom
85-
content in this area.
86-
</td>
87-
</tr>
88-
<tr>
89-
<td>margin: string</td>
90-
<td></td>
91-
<td>
92-
Size of the top margin to be applied to the footer ('xxsmall' |
93-
'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
94-
</td>
95-
</tr>
96-
<tr>
97-
<td>padding: string | object</td>
98-
<td></td>
99-
<td>
100-
<DxcFlex gap="0.25rem" direction="column" alignItems="baseline">
101-
<StatusTag status="Deprecated">Deprecated</StatusTag>
102-
Size of the padding to be applied to the custom area of the
103-
component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large'
104-
| 'xlarge' | 'xxlarge'). You can pass an object with 'top',
105-
'bottom', 'left' and 'right' properties in order to specify
106-
different padding sizes.
107-
</DxcFlex>
108-
</td>
109-
</tr>
110-
<tr>
111-
<td>tabIndex: number</td>
112-
<td>
113-
<Code>0</Code>
114-
</td>
115-
<td>
116-
Value of the tabindex for all interactuable elements, except
117-
those inside the custom area.
118-
</td>
119-
</tr>
120-
</tbody>
121-
</DxcTable>
122-
</>
15+
<DxcTable>
16+
<thead>
17+
<tr>
18+
<th>Name</th>
19+
<th>Default</th>
20+
<HeaderDescriptionCell>Description</HeaderDescriptionCell>
21+
</tr>
22+
</thead>
23+
<tbody>
24+
<tr>
25+
<td>socialLinks: object[]</td>
26+
<td>
27+
<Code>[]</Code>
28+
</td>
29+
<td>
30+
An array of objects representing the links that will be rendered
31+
as icons at the top-right side of the footer. Each object has the
32+
following properties:
33+
<ul>
34+
<li>
35+
<b>logo</b>: Element or path used as the icon for the link.
36+
</li>
37+
<li>
38+
<b>href</b>: URL of the page the link goes to.
39+
</li>
40+
</ul>
41+
</td>
42+
</tr>
43+
<tr>
44+
<td>bottomLinks: object[]</td>
45+
<td>
46+
<Code>[]</Code>
47+
</td>
48+
<td>
49+
An array of objects representing the links that will be rendered
50+
at the bottom part of the footer. Each object has the following
51+
properties:
52+
<ul>
53+
<li>
54+
<b>text</b>: Text for the link.
55+
</li>
56+
<li>
57+
<b>href</b>: URL of the page the link goes to.
58+
</li>
59+
</ul>
60+
</td>
61+
</tr>
62+
<tr>
63+
<td>copyright: string</td>
64+
<td></td>
65+
<td>The text that will be displayed as copyright disclaimer.</td>
66+
</tr>
67+
<tr>
68+
<td>children: node</td>
69+
<td></td>
70+
<td>
71+
The center section of the footer. Can be used to render custom
72+
content in this area.
73+
</td>
74+
</tr>
75+
<tr>
76+
<td>margin: string</td>
77+
<td></td>
78+
<td>
79+
Size of the top margin to be applied to the footer ('xxsmall' |
80+
'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
81+
</td>
82+
</tr>
83+
<tr>
84+
<td>tabIndex: number</td>
85+
<td>
86+
<Code>0</Code>
87+
</td>
88+
<td>
89+
Value of the tabindex for all interactuable elements, except those
90+
inside the custom area.
91+
</td>
92+
</tr>
93+
</tbody>
94+
</DxcTable>
12395
),
12496
},
12597
{

0 commit comments

Comments
 (0)