Skip to content

Commit

Permalink
fix(guide): images
Browse files Browse the repository at this point in the history
(cherry picked from commit b994b1d)
  • Loading branch information
tomasklim authored and matejkriz committed Jun 6, 2022
1 parent 79d2545 commit 40f2f50
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion packages/suite-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"devDependencies": {
"@babel/preset-env": "^7.13.15",
"@babel/preset-typescript": "^7.13.0",
"@trezor/utils": "*",
"@types/fs-extra": "^9.0.6",
"@types/ua-parser-js": "^0.7.35",
"ajv": "^8.6.2",
Expand Down
3 changes: 1 addition & 2 deletions packages/suite-data/src/guide/parser.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { join } from 'path';
import * as fs from 'fs-extra';

import { resolveStaticPath } from '@trezor/utils';
import { GITBOOK_ASSETS_DIR_PREFIX } from './constants';

/**
Expand Down Expand Up @@ -87,7 +86,7 @@ export class Parser {
// which creates unnecessary backslash which is then converted to slash in browser and breaks the image url
?.replace(/\\/g, '');

return image ? resolveStaticPath(`/guide/${image}`) : undefined;
return image ? `/guide/${image}` : undefined;
}

/** Returns a title of given page. */
Expand Down
3 changes: 1 addition & 2 deletions packages/suite-data/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
"noImplicitAny": false,
"outDir": "./libDev"
},
"include": ["./src"],
"references": [{ "path": "../utils" }]
"include": ["./src"]
}
3 changes: 2 additions & 1 deletion packages/suite/src/components/guide/GuideNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import styled from 'styled-components';
import { darken } from 'polished';
import { analytics, EventType } from '@trezor/suite-analytics';
import { resolveStaticPath } from '@trezor/utils';

import { Icon, variables, useTheme } from '@trezor/components';
import { useActions, useSelector } from '@suite-hooks';
Expand Down Expand Up @@ -111,7 +112,7 @@ export const GuideNode = ({ node, description }: GuideNodeProps) => {
if (node.type === 'category') {
return (
<CategoryNodeButton data-test={`@guide/category${node.id}`} onClick={navigateToNode}>
{node.image && <Image src={node.image} />}
{node.image && <Image src={resolveStaticPath(node.image)} />}
{label}
</CategoryNodeButton>
);
Expand Down

0 comments on commit 40f2f50

Please sign in to comment.