Skip to content

Commit

Permalink
Merge pull request #34 from microsoft/bug/cards-collapsed-on-safari
Browse files Browse the repository at this point in the history
Fix Card rendering on Safari, small lint issues
  • Loading branch information
pamtaro authored Oct 9, 2020
2 parents f6ae393 + 70dadca commit 8d9f3e1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
28 changes: 15 additions & 13 deletions src/components/LargeCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import { useTheme } from '@fluentui/react-theme-provider';
import { Card, CardSection } from '@uifabric/react-cards';

export interface LargeCardProps {
alignToStart?: boolean;
Expand All @@ -9,20 +8,23 @@ export interface LargeCardProps {
const LargeCard: React.FunctionComponent<LargeCardProps> = ({ alignToStart, children }) => {
const theme = useTheme();
return (
<Card
styles={{
root: {
padding: theme.spacing.l1,
backgroundColor: theme.palette.white,
marginBottom: theme.spacing.l1,
alignItems: alignToStart ? 'flex-start' : 'stretch',
height: 'auto',
maxWidth: 'auto',
},
<div
style={{
padding: theme.spacing.l1,
backgroundColor: theme.palette.white,
marginBottom: theme.spacing.l1,
alignItems: alignToStart ? 'flex-start' : 'stretch',
height: 'auto',
maxWidth: 'auto',
borderTopLeftRadius: 2,
borderTopRightRadius: 2,
borderBottomRightRadius: 2,
borderBottomLeftRadius: 2,
boxShadow: 'rgba(0, 0, 0, 0.133) 0px 1.6px 3.6px 0px, rgba(0, 0, 0, 0.11) 0px 0.3px 0.9px 0px',
}}
>
<CardSection styles={{ root: { width: '100%' } }}>{children || null}</CardSection>
</Card>
{children || null}
</div>
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/mocks/MockDataAccess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class MockDataAccess implements DataAccess {
async getElections(): Promise<Election[]> {
const mockElection: Election = {
id: mockDescription.election_scope_id,
election_description: mockDescription,
election_description: mockDescription as any,
state: 'Published',
};
return [mockElection];
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ElectionPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Stack, Text } from '@fluentui/react';
import { Stack } from '@fluentui/react';

import AsyncContent from '../components/AsyncContent';
import ElectionTitle from '../components/ElectionTitle';
Expand Down

0 comments on commit 8d9f3e1

Please sign in to comment.