Skip to content

Commit 3958a0e

Browse files
authored
Language selection expansion panel tooltip (#471)
* [QOL] Added language selection tooltip
1 parent 4d6f06c commit 3958a0e

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from 'react'
2+
import { connect } from 'react-redux'
3+
import { Typography } from '@material-ui/core'
4+
5+
const GameLanguageSelection = () => (
6+
<Typography paragraph>
7+
To select a language, go to the Expansion tab above and use the edit button
8+
to select the language for each Expansion.
9+
</Typography>
10+
)
11+
12+
export default connect()(React.memo(GameLanguageSelection))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import React from 'react'
2+
3+
import useExpansionHandling from 'hooks/useExpansionHandling'
4+
5+
import ExpansionPanel from 'components/molecules/ExpansionPanel'
6+
import GameLanguageSelection from './GameLanguageSelection/GameLanguageSelection'
7+
8+
const Language = () => {
9+
const { expanded, createExpansionHandler } = useExpansionHandling()
10+
const expansionKey = 'languageSelectionSet'
11+
const expansionHandler = createExpansionHandler(expansionKey)
12+
13+
return (
14+
<ExpansionPanel
15+
expanded={expanded}
16+
expansionHandler={expansionHandler}
17+
expansionKey={expansionKey}
18+
summary="Language Selection"
19+
data-test="LanguageSelection"
20+
>
21+
<GameLanguageSelection />
22+
</ExpansionPanel>
23+
)
24+
}
25+
26+
export default React.memo(Language)

src/components/pages/Settings/index.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ import React from 'react'
22

33
import Expansions from './Expansions'
44
import Supply from './Supply'
5+
import Language from './Language'
56

67
const Settings = () => (
78
<React.Fragment>
89
<Expansions />
910
<Supply />
11+
<Language />
1012
</React.Fragment>
1113
)
1214

0 commit comments

Comments
 (0)