back to logic gates

This commit is contained in:
Matei Adriel 2019-08-01 23:21:40 +03:00
parent 2c6fa3a281
commit 76e48bf8d5
6 changed files with 37 additions and 14 deletions

View file

@ -4,23 +4,42 @@ import ListItemIcon from '@material-ui/core/ListItemIcon'
import ListItemText from '@material-ui/core/ListItemText'
import Icon from '@material-ui/core/Icon'
import { useTranslation } from '../../internalisation/helpers/useLanguage'
import { Link } from 'react-router-dom'
const BackToSimulation = () => {
const translation = useTranslation()
import { Link, Route } from 'react-router-dom'
const linkButton = (to: string, text: string, contained = true) => {
const a = 'arrow_back_ios'
return (
<Link to="/">
<ListItem button className="contained">
<Link to={to}>
<ListItem button className={contained ? 'contained' : ''}>
<ListItemIcon>
<Icon>arrow_back_ios</Icon>
<Icon>
{contained ? 'device_hub' : 'keyboard_arrow_left'}
</Icon>
</ListItemIcon>
<ListItemText>
{translation.sidebar.backToSimulation}
</ListItemText>
<ListItemText>{text}</ListItemText>
</ListItem>
</Link>
)
}
const BackToSimulation = () => {
const translation = useTranslation()
return (
<>
{linkButton('/', translation.sidebar.backToSimulation)}
<Route
path="/info/:name"
component={() => {
return linkButton(
'/gates',
translation.sidebar.backToGates,
false
)
}}
/>
</>
)
}
export default BackToSimulation

View file

@ -11,7 +11,8 @@ export const EnglishTranslation: Translation = {
openSimulation: 'Open simulations',
simulation: 'Simulation',
language: 'Language',
backToSimulation: 'Back to simulation'
backToSimulation: 'Back to simulation',
backToGates: 'Back to logic gates'
},
createSimulation: {
mode: {

View file

@ -11,7 +11,8 @@ export const DutchTranslation: Translation = {
openSimulation: 'Open simulatie',
simulation: 'Todo',
language: 'Taal',
backToSimulation: 'Todo'
backToSimulation: 'Todo',
backToGates: 'Todo'
},
actions: {
'delete selection': 'Todo',

View file

@ -11,7 +11,8 @@ export const RomanianTranslation: Translation = {
logicGates: 'Porți logice',
simulation: 'Simulație',
language: 'Limba',
backToSimulation: 'Înapoi la simulație'
backToSimulation: 'Înapoi la simulație',
backToGates: 'Înapoi la porțile logice'
},
createSimulation: {
mode: {

View file

@ -17,6 +17,7 @@ export interface Translation {
simulation: string
language: string
backToSimulation: string
backToGates: string
}
createSimulation: {
mode: {

View file

@ -58,7 +58,7 @@ export const descriptions: Record<string, string> = {
only true if a === b and the 3rd input is only true if a < b.
`,
'parallel delayer': `
Delays the inputs by a certain delay. ${delay}
Delays the inputs by a amount of time. ${delay}
`,
'sequential delayer': `
Delays the input by a certain amount of time relative to the last change. ${delay}