Skip to content
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
5 changes: 3 additions & 2 deletions src/components/Modal/contents/DownloadOurAppModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
ModalBody,
ModalFlex
} from './styled'
import Image from '../../atoms/Image'

const DownloadOurAppModal = () => {
return (
Expand All @@ -17,11 +18,11 @@ const DownloadOurAppModal = () => {
<ModalBody>
<ModalFlex>
<div className='center'>
<img src='/app/static/Desktop.svg' />
<Image src='/app/static/Desktop.svg' />
<button className='button'>Download for Mac</button>
</div>
<div className='center'>
<img src='/app/static/Mobile.svg' />
<Image src='/app/static/Mobile.svg' />
<button className='button darker' disabled={true}>
Launching Soon
</button>
Expand Down
10 changes: 2 additions & 8 deletions src/components/PreferencesModal/AboutTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
PrimaryAnchor
} from './styled'
import { openNew } from '../../lib/utils/platform'
import isElectron from 'is-electron'
import Image from '../atoms/Image'

const AboutContents = styled.div`
max-width: 360px;
Expand Down Expand Up @@ -104,13 +104,7 @@ const AboutTab = () => {
<SectionHeader>About</SectionHeader>
<div className='about-outline-basic'>
<div className='about-outline-basic-logo'>
<img
src={
isElectron()
? 'app/static/logo.svg'
: '/app/static/logo.svg'
}
/>
<Image src={'/app/static/logo.svg'} />
</div>
<div className='about-outline-basic-info'>
<h4>Boost Note {process.env.VERSION}</h4>
Expand Down
19 changes: 19 additions & 0 deletions src/components/atoms/Image.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React, { CSSProperties } from 'react'
import isElectron from 'is-electron'

interface ImageProps {
src: string
className?: string
style?: CSSProperties
alt?: string
}

const Image = ({ src, className, style, alt }: ImageProps) => {
if (isElectron() && src.startsWith('/app')) {
src = src.slice(1)
}

return <img src={src} className={className} style={style} alt={alt} />
}

export default Image
2 changes: 1 addition & 1 deletion src/lib/router/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface RouterStore extends Location {
}

const initialLocation = normalizeLocation({
pathname: bhistory.location.pathname,
pathname: isElectron() ? '/app' : bhistory.location.pathname,
hash: bhistory.location.hash,
query: parseQuery(bhistory.location.search)
})
Expand Down