Skip to content

Commit

Permalink
Merge pull request #606 from audioverse-org/list-books
Browse files Browse the repository at this point in the history
List books
  • Loading branch information
jakecoble authored Dec 5, 2024
2 parents d60f3cd + 815a426 commit 4fcd658
Show file tree
Hide file tree
Showing 17 changed files with 178 additions and 4 deletions.
12 changes: 12 additions & 0 deletions public/compiled-lang/br.json
Original file line number Diff line number Diff line change
Expand Up @@ -4109,6 +4109,18 @@
"value": "Nossa História"
}
],
"passageNavigation__selector-grid": [
{
"type": 0,
"value": "Grid"
}
],
"passageNavigation__selector-list": [
{
"type": 0,
"value": "List"
}
],
"personTypeLockup_type": [
{
"type": 0,
Expand Down
12 changes: 12 additions & 0 deletions public/compiled-lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -4109,6 +4109,18 @@
"value": "Our Story"
}
],
"passageNavigation__selector-grid": [
{
"type": 0,
"value": "Grid"
}
],
"passageNavigation__selector-list": [
{
"type": 0,
"value": "List"
}
],
"personTypeLockup_type": [
{
"type": 0,
Expand Down
12 changes: 12 additions & 0 deletions public/compiled-lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4105,6 +4105,18 @@
"value": "Our Story"
}
],
"passageNavigation__selector-grid": [
{
"type": 0,
"value": "Grid"
}
],
"passageNavigation__selector-list": [
{
"type": 0,
"value": "List"
}
],
"personTypeLockup_type": [
{
"type": 0,
Expand Down
12 changes: 12 additions & 0 deletions public/compiled-lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -4125,6 +4125,18 @@
"value": "Our Story"
}
],
"passageNavigation__selector-grid": [
{
"type": 0,
"value": "Grid"
}
],
"passageNavigation__selector-list": [
{
"type": 0,
"value": "List"
}
],
"personTypeLockup_type": [
{
"type": 0,
Expand Down
12 changes: 12 additions & 0 deletions public/compiled-lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -4101,6 +4101,18 @@
"value": "Our Story"
}
],
"passageNavigation__selector-grid": [
{
"type": 0,
"value": "Grid"
}
],
"passageNavigation__selector-list": [
{
"type": 0,
"value": "List"
}
],
"personTypeLockup_type": [
{
"type": 0,
Expand Down
12 changes: 12 additions & 0 deletions public/compiled-lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -4117,6 +4117,18 @@
"value": "Our Story"
}
],
"passageNavigation__selector-grid": [
{
"type": 0,
"value": "Grid"
}
],
"passageNavigation__selector-list": [
{
"type": 0,
"value": "List"
}
],
"personTypeLockup_type": [
{
"type": 0,
Expand Down
12 changes: 12 additions & 0 deletions public/compiled-lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -4109,6 +4109,18 @@
"value": "Our Story"
}
],
"passageNavigation__selector-grid": [
{
"type": 0,
"value": "Grid"
}
],
"passageNavigation__selector-list": [
{
"type": 0,
"value": "List"
}
],
"personTypeLockup_type": [
{
"type": 0,
Expand Down
12 changes: 12 additions & 0 deletions public/compiled-lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -4125,6 +4125,18 @@
"value": "Our Story"
}
],
"passageNavigation__selector-grid": [
{
"type": 0,
"value": "Grid"
}
],
"passageNavigation__selector-list": [
{
"type": 0,
"value": "List"
}
],
"personTypeLockup_type": [
{
"type": 0,
Expand Down
8 changes: 8 additions & 0 deletions public/lang/br.json
Original file line number Diff line number Diff line change
Expand Up @@ -2735,5 +2735,13 @@
},
"bibles__history": {
"string": "Histórico"
},
"passageNavigation__selector-grid": {
"comment": "Switch to grid view",
"string": "Grid"
},
"passageNavigation__selector-list": {
"comment": "Switch to list view",
"string": "List"
}
}
8 changes: 8 additions & 0 deletions public/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -2735,5 +2735,13 @@
},
"bibles__history": {
"string": "Verlauf"
},
"passageNavigation__selector-grid": {
"comment": "Switch to grid view",
"string": "Grid"
},
"passageNavigation__selector-list": {
"comment": "Switch to list view",
"string": "List"
}
}
8 changes: 8 additions & 0 deletions public/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1974,6 +1974,14 @@
"ourStory__title": {
"string": "Our Story"
},
"passageNavigation__selector-grid": {
"comment": "Switch to grid view",
"string": "Grid"
},
"passageNavigation__selector-list": {
"comment": "Switch to list view",
"string": "List"
},
"personTypeLockup_type": {
"string": "Presenter"
},
Expand Down
8 changes: 8 additions & 0 deletions public/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -2735,5 +2735,13 @@
},
"bibles__history": {
"string": "Historial"
},
"passageNavigation__selector-grid": {
"comment": "Switch to grid view",
"string": "Grid"
},
"passageNavigation__selector-list": {
"comment": "Switch to list view",
"string": "List"
}
}
8 changes: 8 additions & 0 deletions public/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2735,5 +2735,13 @@
},
"bibles__history": {
"string": "Historique"
},
"passageNavigation__selector-grid": {
"comment": "Switch to grid view",
"string": "Grid"
},
"passageNavigation__selector-list": {
"comment": "Switch to list view",
"string": "List"
}
}
8 changes: 8 additions & 0 deletions public/lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -2735,5 +2735,13 @@
},
"bibles__history": {
"string": "履歴"
},
"passageNavigation__selector-grid": {
"comment": "Switch to grid view",
"string": "Grid"
},
"passageNavigation__selector-list": {
"comment": "Switch to list view",
"string": "List"
}
}
8 changes: 8 additions & 0 deletions public/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -2735,5 +2735,13 @@
},
"bibles__history": {
"string": "История"
},
"passageNavigation__selector-grid": {
"comment": "Switch to grid view",
"string": "Grid"
},
"passageNavigation__selector-list": {
"comment": "Switch to list view",
"string": "List"
}
}
8 changes: 8 additions & 0 deletions public/lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -2735,5 +2735,13 @@
},
"bibles__history": {
"string": "历史"
},
"passageNavigation__selector-grid": {
"comment": "Switch to grid view",
"string": "Grid"
},
"passageNavigation__selector-list": {
"comment": "Switch to list view",
"string": "List"
}
}
22 changes: 18 additions & 4 deletions src/components/organisms/passageNavigation.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import clsx from 'clsx';
import React, { useRef, useState } from 'react';
import React, { useState } from 'react';
import { FormattedMessage } from 'react-intl';

import { useLocalStorage } from '~src/lib/hooks/useLocalStorage';

import { PassageNavigationFragment } from './__generated__/passageNavigation';
import BookGrid from './bookGrid';
Expand Down Expand Up @@ -57,7 +60,10 @@ export default function PassageNavigation({ books }: Props): JSX.Element {
const [selectedBook, setSelectedBook] = useState<string | number | null>(
null,
);
const [selectedView, setSelectedView] = useState<'grid' | 'list'>('grid');
const [selectedView, setSelectedView] = useLocalStorage<'grid' | 'list'>(
'passageNavLayout',
'grid',
);

return (
<div className={styles.wrapper}>
Expand All @@ -66,13 +72,21 @@ export default function PassageNavigation({ books }: Props): JSX.Element {
className={clsx({ active: selectedView === 'grid' })}
onClick={() => setSelectedView('grid')}
>
Grid
<FormattedMessage
id="passageNavigation__selector-grid"
defaultMessage="Grid"
description="Switch to grid view"
/>
</button>
<button
className={clsx({ active: selectedView === 'list' })}
onClick={() => setSelectedView('list')}
>
List
<FormattedMessage
id="passageNavigation__selector-list"
defaultMessage="List"
description="Switch to list view"
/>
</button>
</div>

Expand Down

0 comments on commit 4fcd658

Please sign in to comment.