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

Fix/tutorial custom content width #41

Merged
merged 3 commits into from
Oct 25, 2024
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: 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