Skip to content

Commit

Permalink
Merge pull request #41 from equinor/fix/tutorial-custom-content-width
Browse files Browse the repository at this point in the history
Fix/tutorial custom content width
  • Loading branch information
aslakihle authored Oct 25, 2024
2 parents d53af25 + 71470d1 commit 78f736d
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@equinor/subsurface-app-management",
"version": "1.1.17",
"version": "1.1.18",
"description": "React Typescript components/hooks to communicate with equinor/sam",
"types": "dist/index.d.ts",
"type": "module",
Expand Down
11 changes: 8 additions & 3 deletions src/providers/TutorialProvider/TutorialDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CSSProperties, FC, useMemo } from 'react';

import { Button, Typography } from '@equinor/eds-core-react';
import { Button } from '@equinor/eds-core-react';

import {
DIALOG_EDGE_MARGIN,
Expand All @@ -11,6 +11,7 @@ import {
DialogActions,
DialogContent,
DialogImage,
DialogTypography,
DialogWrapper,
NavigateSteps,
StyledTutorialDialog,
Expand Down Expand Up @@ -50,8 +51,12 @@ const TutorialDialog: FC = () => {
) {
return (
<>
<Typography>{currentStepObject.title}</Typography>
<Typography>{currentStepObject.body}</Typography>
<DialogTypography variant="h5">
{currentStepObject.title}
</DialogTypography>
<DialogTypography group="paragraph" variant="body_short">
{currentStepObject.body}
</DialogTypography>
{currentStepObject.imgUrl && sasToken && (
<DialogImage
data-testid="tutorial-image"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const CustomComponentWrapper = styled.div`
display: grid;
grid-template-columns: 24px 1fr;
gap: 24px;
width: 500px;
`;

const SmallOrangeLine = styled.div`
Expand Down
7 changes: 6 additions & 1 deletion src/providers/TutorialProvider/TutorialProvider.styles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Dialog } from '@equinor/eds-core-react';
import { Dialog, Typography } from '@equinor/eds-core-react';
import { tokens } from '@equinor/eds-tokens';

import styled, { keyframes } from 'styled-components';
Expand Down Expand Up @@ -58,12 +58,17 @@ export const DialogContent = styled.div`
display: flex;
flex-direction: column;
gap: ${spacings.comfortable.large};
width: fit-content;
`;

export const DialogTypography = styled(Typography)`
width: 300px;
`;

export const DialogImage = styled.img`
max-height: 300px;
min-height: 50px;
max-width: 300px;
object-fit: contain;
`;

Expand Down
2 changes: 1 addition & 1 deletion src/providers/TutorialProvider/TutorialProviderInner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const TutorialProviderInner: FC = () => {
}, [activeTutorial, allElementsToHighlight, currentStep, viewportWidth]);

const tutorialsForPath = useMemo(() => {
return appTutorials.filter((item) => item.path === pathname);
return appTutorials.filter((item) => pathname.includes(item.path));
}, [appTutorials, pathname]);

const runTutorial = useCallback(
Expand Down

0 comments on commit 78f736d

Please sign in to comment.