Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨(frontend) replace grommet Heading #2410

Merged
merged 2 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed

- Replace grommet Heading (#2410)

## [4.5.0] - 2023-09-15

### Changed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Box, Heading } from 'grommet';
import { Box } from 'grommet';
import { useCreateClassroom } from 'lib-classroom';
import { Heading } from 'lib-components';
import React from 'react';
import { useIntl } from 'react-intl';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Select } from '@openfun/cunningham-react';
import { Box, Heading, Pagination, Paragraph, Text } from 'grommet';
import { Box, Pagination, Paragraph, Text } from 'grommet';
import { Maybe } from 'lib-common';
import { FileDepository, Loader } from 'lib-components';
import { FileDepository, Heading, Loader } from 'lib-components';
import React, { FocusEvent, useState } from 'react';
import { FormattedMessage, defineMessages, useIntl } from 'react-intl';

Expand Down Expand Up @@ -153,6 +153,7 @@ export const DashboardInstructor = ({
onBlur={onBlurTitle}
onFocus={onFocusTitle}
suppressContentEditableWarning={true}
style={{ lineHeight: '50px' }}
>
{fileDepository.title || intl.formatMessage(messages.noTitle)}
</Heading>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Box, Grid, Heading, Paragraph } from 'grommet';
import { FileDepository, Loader, useResponsive } from 'lib-components';
import { Box, Grid, Paragraph } from 'grommet';
import { FileDepository, Heading, Loader, useResponsive } from 'lib-components';
import React from 'react';
import { FormattedMessage, defineMessages } from 'react-intl';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Box, Heading } from 'grommet';
import { Box } from 'grommet';
import { Heading } from 'lib-components';
import React from 'react';
import { useIntl } from 'react-intl';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Box, Heading } from 'grommet';
import { Box } from 'grommet';
import { Heading } from 'lib-components';
import { useCreateMarkdownDocument } from 'lib-markdown';
import React from 'react';
import { useIntl } from 'react-intl';
Expand Down

This file was deleted.

22 changes: 13 additions & 9 deletions src/frontend/apps/lti_site/components/DashboardDocument/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Box } from 'grommet';
import {
Document,
Heading,
ObjectStatusPicker,
UploadManagerStatus,
UploadableObjectProgress,
Expand All @@ -13,7 +14,6 @@ import React, { useEffect } from 'react';
import { FormattedMessage, defineMessages, useIntl } from 'react-intl';
import styled from 'styled-components';

import { DashboardInternalHeading } from 'components/Dashboard/DashboardInternalHeading';
import { pollForTrack } from 'data/sideEffects/pollForTrack';

import { DashboardDocumentPaneButtons } from './DashboardDocumentPaneButtons';
Expand Down Expand Up @@ -54,10 +54,6 @@ const DashboardDocumentInnerContainer = styled.div`
padding: 1rem;
`;

const DashboardDocumentInternalHeading = styled(DashboardInternalHeading)`
padding: 0 1rem 0 0;
`;

const CommonStatusLine = ({
document,
documentUploadStatus,
Expand All @@ -66,9 +62,13 @@ const CommonStatusLine = ({
documentUploadStatus?: UploadManagerStatus;
}) => (
<Box align="center" direction="row">
<DashboardDocumentInternalHeading>
<Heading
level={5}
style={{ margin: 0, paddingRight: '1rem' }}
color="var(--c--theme--colors--secondary-text)"
>
<FormattedMessage {...messages.title} />
</DashboardDocumentInternalHeading>
</Heading>
<ObjectStatusPicker object={document} uploadStatus={documentUploadStatus} />
</Box>
);
Expand Down Expand Up @@ -109,9 +109,13 @@ const DashboardDocument = (props: DashboardDocumentProps) => {
/>
{intl.formatMessage(messages[READY])}
<Box align="center" direction="row" margin={{ top: 'small' }}>
<DashboardDocumentInternalHeading>
<Heading
level={5}
style={{ margin: 0, paddingRight: '1rem' }}
color="var(--c--theme--colors--secondary-text)"
>
{intl.formatMessage(messages.filename)}
</DashboardDocumentInternalHeading>
</Heading>
<div>{document.filename}</div>
</Box>
</Box>
Expand Down
15 changes: 10 additions & 5 deletions src/frontend/apps/lti_site/components/PortabilityRequest/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { Box, Button, Heading, Paragraph } from 'grommet';
import { Box, Button, Paragraph } from 'grommet';
import { Clock } from 'grommet-icons';
import { DecodedJwtLTI, PortabilityConfig, useJwt } from 'lib-components';
import {
DecodedJwtLTI,
Heading,
PortabilityConfig,
useJwt,
} from 'lib-components';
import React from 'react';
import toast from 'react-hot-toast';
import { FormattedMessage, defineMessages, useIntl } from 'react-intl';
Expand Down Expand Up @@ -94,12 +99,12 @@ export const PortabilityRequest = ({

return (
<Box direction="column" pad="medium" align="center">
<Heading level={6} margin={{ bottom: 'small' }}>
<Heading level={5}>
<FormattedMessage {...messages.resourceRequiresPortability} />
</Heading>
{portabilityRequested ? (
<React.Fragment>
<Paragraph>
<Paragraph margin={{ top: 'small' }}>
<FormattedMessage
{...messages.resourcePortabilityAlreadyRequested}
/>
Expand All @@ -108,7 +113,7 @@ export const PortabilityRequest = ({
</React.Fragment>
) : (
<React.Fragment>
<Paragraph>
<Paragraph margin={{ top: 'small' }}>
<FormattedMessage {...messages.pleaseMakeRequest} />
</Paragraph>
<Button
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Box, Heading } from 'grommet';
import { Box } from 'grommet';
import {
Document,
Heading,
Live,
LiveModeType,
Loader,
Expand Down
109 changes: 0 additions & 109 deletions src/frontend/apps/lti_site/components/UploadsView/index.spec.tsx

This file was deleted.

Loading