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

chore: list styles, BG Map Management #678

Open
wants to merge 46 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
e7bb0fa
chore: added map-server to main thread
ErikSin Nov 28, 2022
eba9734
chore: scaffolded useMapServerQuery
ErikSin Nov 28, 2022
f5493be
chore: sampled typings
ErikSin Nov 28, 2022
bfbeb15
chore: JSDoc overload example
gmaclennan Nov 29, 2022
c9098f1
chore: Added custom hooks
ErikSin Dec 7, 2022
69dbd01
chore: update query invalidation
ErikSin Dec 7, 2022
fdeab8b
chore: update styles endpoint typing to return array
ErikSin Dec 7, 2022
2eec2d2
chore: ran electron-rebuild
ErikSin Dec 8, 2022
0574610
chore: update hooks
ErikSin Dec 8, 2022
68b6155
chore: update query invalidation to be more general
ErikSin Dec 10, 2022
e5f43f0
feat: Added settings tab
ErikSin Apr 17, 2022
36a98e9
chore: Added Translations
ErikSin Apr 17, 2022
0b15b12
chore: updated jsdoc types
ErikSin Apr 17, 2022
bb5af49
chore: updated translations
ErikSin Apr 18, 2022
e45a4ff
chore: translations
ErikSin Apr 18, 2022
9f4528a
chore: updated Types
ErikSin Apr 19, 2022
e31636a
chore: lazy load bg map info
ErikSin Apr 18, 2022
80e3223
chore: translations
ErikSin Apr 18, 2022
4b4da91
chore: Added zoom level definitions
ErikSin Apr 19, 2022
967e673
chore: translations
ErikSin Apr 19, 2022
546c209
chore: clean up
ErikSin Apr 19, 2022
3a46007
chore: translations
ErikSin Apr 19, 2022
11860e6
chore: Added offline area cards
ErikSin Apr 20, 2022
9f3a035
chore: translations
ErikSin Apr 20, 2022
9e4edb4
chore: Added type checking
ErikSin Apr 21, 2022
c36ab9e
chore: Cleaned up buttons
ErikSin Apr 25, 2022
d1ef2b4
chore: translations
ErikSin Apr 25, 2022
9986517
chore: linting fix for CI
ErikSin Apr 25, 2022
222be4c
chore: updated components with tanstack hooks
ErikSin Dec 7, 2022
8037109
chore: translations
ErikSin Dec 7, 2022
755b8d4
chore: added api logic to ui
ErikSin Dec 8, 2022
fd653ef
chore: add map and list styles
ErikSin Dec 10, 2022
968d9ee
chore: translations
ErikSin Dec 10, 2022
49ac141
chore: update dialog UI for import maps
ErikSin Dec 15, 2022
c66092a
chore: translations
ErikSin Dec 15, 2022
b962312
chore: create one instance of mapbox for prev
ErikSin Dec 15, 2022
f315ea0
chore: map card showing map
ErikSin Jan 19, 2023
7bc6d2a
chore: added summary of map
ErikSin Jan 19, 2023
5339099
chore: translations
ErikSin Jan 19, 2023
6f840a5
Merge branch 'master' into BGMapCards
ErikSin Jan 19, 2023
b6ddb86
chore: linting issues
ErikSin Jan 19, 2023
233d07f
chore: clean up excess brackets
ErikSin Jan 19, 2023
35536ba
update mapInfo
ErikSin Feb 6, 2023
7591f07
chore translations
ErikSin Feb 6, 2023
73472a2
chore: took out conditional rendering of settings
ErikSin Feb 6, 2023
c607d02
center icon
ErikSin Feb 7, 2023
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
Prev Previous commit
Next Next commit
chore: map card showing map
  • Loading branch information
ErikSin committed Jan 19, 2023
commit f315ea074181d6277b64eed22a96a1f0f0e7c917
3 changes: 1 addition & 2 deletions src/renderer/components/BackgroundMaps/BackgroundMapInfo.js
Original file line number Diff line number Diff line change
@@ -2,10 +2,8 @@
import { Button, Fade, makeStyles, Paper, Typography } from '@material-ui/core'
import * as React from 'react'
import { defineMessages, useIntl } from 'react-intl'
import ReactMapboxGl from 'react-mapbox-gl'
import DeleteIcon from '@material-ui/icons/DeleteForeverOutlined'

import { MAPBOX_ACCESS_TOKEN } from '../../../../config'
import Loading from '../Loading'
import { useMapServerQuery } from '../../hooks/useMapServerQuery'
import { MapboxPrevOnly } from './MapCard'
@@ -115,6 +113,7 @@ const MapInfo = ({ name, id, unsetMapValue, url }) => {
<MapboxPrevOnly
style={url}
containerStyle={{ height: '60%', width: '100%' }}
zoom={[0]}
/>
</React.Fragment>
)
6 changes: 3 additions & 3 deletions src/renderer/components/BackgroundMaps/MapCard.js
Original file line number Diff line number Diff line change
@@ -20,8 +20,7 @@ export const MapboxPrevOnly = ReactMapboxGl({
dragRotate: false,
pitchWithRotate: false,
attributionControl: false,
injectCSS: false,
interactive: false
injectCSS: false
})

/**
@@ -53,12 +52,13 @@ export const MapCard = ({ offlineMap, setMap, isBeingViewed }) => {
width: '100%'
}}
style={offlineMap.url}
zoom={[0]}
/>
</div>
<div className={classes.text}>
<Typography>{offlineMap.name}</Typography>
<Typography variant='subtitle1'>
{`${convertKbToMb(offlineMap.bytesStored)} ${t(m.mb)}`}
{`${Math.round(convertKbToMb(offlineMap.bytesStored))} ${t(m.mb)}`}
</Typography>
</div>
</div>
2 changes: 1 addition & 1 deletion src/renderer/components/Settings/BackgroundMaps.js
Original file line number Diff line number Diff line change
@@ -80,5 +80,5 @@ export const BackgroundMaps = ({ openSettings }) => {
* @returns {number}
*/
export const convertKbToMb = kilobyte => {
return Math.round(kilobyte / 1000)
return kilobyte / 2 ** 20
}