From 54ce0ebdd67a59ff53080f96c3ae06dfdc8b8012 Mon Sep 17 00:00:00 2001 From: Samira Mokaram Date: Thu, 17 Dec 2020 16:26:13 +0100 Subject: [PATCH] remove AboutCard and rename IconLinkVertical and revert some changes --- .../src/components/AboutCard/AboutCard.tsx | 72 ------------------- .../HeaderIconLinkRow.tsx} | 6 +- .../IconLinkVertical.tsx | 0 .../{AboutCard => HeaderIconLinkRow}/index.ts | 3 +- .../{AboutCard => HeaderIconLinkRow}/types.ts | 2 +- packages/core/src/components/index.ts | 2 +- .../src/components/AboutCard/AboutCard.tsx | 67 ++++++++++++----- .../src/components/PagerDutyCard.tsx | 52 ++++++++------ 8 files changed, 84 insertions(+), 120 deletions(-) delete mode 100644 packages/core/src/components/AboutCard/AboutCard.tsx rename packages/core/src/components/{AboutCard/SubHeader.tsx => HeaderIconLinkRow/HeaderIconLinkRow.tsx} (90%) rename packages/core/src/components/{AboutCard => HeaderIconLinkRow}/IconLinkVertical.tsx (100%) rename packages/core/src/components/{AboutCard => HeaderIconLinkRow}/index.ts (86%) rename packages/core/src/components/{AboutCard => HeaderIconLinkRow}/types.ts (96%) diff --git a/packages/core/src/components/AboutCard/AboutCard.tsx b/packages/core/src/components/AboutCard/AboutCard.tsx deleted file mode 100644 index e18894f3fb..0000000000 --- a/packages/core/src/components/AboutCard/AboutCard.tsx +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2020 Spotify AB - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import React from 'react'; -import { - Card, - CardContent, - CardHeader, - Divider, - makeStyles, -} from '@material-ui/core'; -import { SubHeader } from './SubHeader'; -import { SubHeaderLink } from './types'; - -const useStyles = makeStyles({ - gridItemCard: { - display: 'flex', - flexDirection: 'column', - height: 'calc(100% - 10px)', // for pages without content header - marginBottom: '10px', - }, - gridItemCardContent: { - flex: 1, - }, -}); - -type Props = { - title: string; - headerClass?: string; - headerAction?: React.ReactNode; - links: SubHeaderLink[]; - contentClass?: string; - content: React.ReactNode; - variant?: string; -}; - -export const AboutCard = ({ - title, - headerAction, - links, - content, - variant, -}: Props) => { - const classes = useStyles(); - return ( - - } - /> - - - {content} - - - ); -}; diff --git a/packages/core/src/components/AboutCard/SubHeader.tsx b/packages/core/src/components/HeaderIconLinkRow/HeaderIconLinkRow.tsx similarity index 90% rename from packages/core/src/components/AboutCard/SubHeader.tsx rename to packages/core/src/components/HeaderIconLinkRow/HeaderIconLinkRow.tsx index 861821f89b..4de3f2b174 100644 --- a/packages/core/src/components/AboutCard/SubHeader.tsx +++ b/packages/core/src/components/HeaderIconLinkRow/HeaderIconLinkRow.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; import { IconLinkVertical } from './IconLinkVertical'; -import { SubHeaderLink } from './types'; +import { HeaderIconLink } from './types'; import { makeStyles } from '@material-ui/core'; const useStyles = makeStyles(theme => ({ @@ -29,10 +29,10 @@ const useStyles = makeStyles(theme => ({ })); type Props = { - links: SubHeaderLink[]; + links: HeaderIconLink[]; }; -export const SubHeader = ({ links }: Props) => { +export const HeaderIconLinkRow = ({ links }: Props) => { const classes = useStyles(); return (