This repository has been archived by the owner on Jul 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
95873b1
commit 6a021bb
Showing
19 changed files
with
213 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/renderer/components/overlays/pref-overlay/entries-pref/EntriesPref.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React, { ReactElement } from "react"; | ||
|
||
import { translations } from "../../../../utils/i18n"; | ||
import FutureEntriesPrefContainer from "./future-entries-pref/FutureEntriesPrefContainer"; | ||
import HideTitlesPrefContainer from "./hide-titles-pref/HideTitlesPrefContainer"; | ||
|
||
/** | ||
* Preference fieldset for options related to diary entries | ||
*/ | ||
export default function EntriesPref(): ReactElement { | ||
return ( | ||
<fieldset className="fieldset-entries"> | ||
<legend>{translations["diary-entries"]}</legend> | ||
<div className="fieldset-content"> | ||
<HideTitlesPrefContainer /> | ||
<br /> | ||
<FutureEntriesPrefContainer /> | ||
</div> | ||
</fieldset> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...tries-pref/FutureEntriesPrefContainer.tsx → ...tries-pref/FutureEntriesPrefContainer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...enderer/components/overlays/pref-overlay/entries-pref/hide-titles-pref/HideTitlesPref.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React, { ReactElement } from "react"; | ||
|
||
import { translations } from "../../../../../utils/i18n"; | ||
|
||
export interface StateProps { | ||
hideTitles: boolean; | ||
} | ||
|
||
export interface DispatchProps { | ||
updateHideTitlesPref: (hideTitles: boolean) => void; | ||
} | ||
|
||
type Props = StateProps & DispatchProps; | ||
|
||
/** | ||
* Preference fieldset for hiding or showing titles for diary entries | ||
*/ | ||
export default function HideTitlesPref(props: Props): ReactElement { | ||
const { hideTitles, updateHideTitlesPref } = props; | ||
|
||
const toggleHideTitles = (): void => updateHideTitlesPref(!hideTitles); | ||
|
||
return ( | ||
<label htmlFor="checkbox-hide-titles"> | ||
<input | ||
type="checkbox" | ||
name="checkbox-hide-titles" | ||
id="checkbox-hide-titles" | ||
checked={hideTitles} | ||
onChange={toggleHideTitles} | ||
/> | ||
{translations["hide-titles"]} | ||
</label> | ||
); | ||
} |
15 changes: 15 additions & 0 deletions
15
...omponents/overlays/pref-overlay/entries-pref/hide-titles-pref/HideTitlesPrefContainer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { connect } from "react-redux"; | ||
|
||
import { updateHideTitlesPref } from "../../../../../store/app/actionCreators"; | ||
import { RootState, ThunkDispatchT } from "../../../../../store/store"; | ||
import HideTitlesPref, { DispatchProps, StateProps } from "./HideTitlesPref"; | ||
|
||
const mapStateToProps = (state: RootState): StateProps => ({ | ||
hideTitles: state.app.hideTitles, | ||
}); | ||
|
||
const mapDispatchToProps = (dispatch: ThunkDispatchT): DispatchProps => ({ | ||
updateHideTitlesPref: (hideTitles: boolean): void => dispatch(updateHideTitlesPref(hideTitles)), | ||
}); | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(HideTitlesPref); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.