Skip to content

Commit

Permalink
Merge pull request #16 from performant-software/RB-state-change-fix
Browse files Browse the repository at this point in the history
Improved handling of state change for image/transcription view components
  • Loading branch information
ajolipa authored May 17, 2024
2 parents aa7dba5 + 18a9a95 commit 0245a25
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
with:
branch: gh-pages # The branch the action should deploy to.
folder: editioncrafter/storybook-static # The folder that the build-storybook script generates files.
clean: true # Automatically remove deleted files from the deploy branch
clean: true # Automatically remove deleted files from the deploy branch
5 changes: 5 additions & 0 deletions editioncrafter/src/component/DocumentView.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ const DocumentView = (props) => {
const navigate = useNavigate();
const location = useLocation();

//"reload" the page if the config props change
useEffect(() => {
dispatchAction(props, 'RouteListenerSaga.userNavigatation', location);
}, [props.config]);

useEffect(() => {
setSinglePaneMode(props.containerWidth < 960);
}, [props.containerWidth]);
Expand Down
6 changes: 4 additions & 2 deletions editioncrafter/stories/EditionCrafter.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,18 @@ export const fullScreen = () => (
export const stateChange = () => {
const [manifest, setManifest] = useState('https://cu-mkp.github.io/editioncrafter/taos-baptisms-example/iiif/manifest.json');
const [glossary, setGlossary] = useState(undefined);
const [title, setTitle] = useState('FHL_007548733_TAOS_BAPTISMS_BATCH_2')

useEffect(() => {
setTimeout(() => {
setManifest('https://cu-mkp.github.io/dyngleyfamily-editioncrafter-data/O_8_35/iiif/manifest.json');
//setManifest('https://cu-mkp.github.io/dyngleyfamily-editioncrafter-data/O_8_35/iiif/manifest.json');
setGlossary('https://cu-mkp.github.io/editioncrafter-data/fr640_3r-3v-example/glossary.json');
setTitle('Taos Baptisms Batch 2');
}, 10000);
}, [])

return (<EditionCrafter
documentName='FHL_007548733_TAOS_BAPTISMS_BATCH_2'
documentName={title}
transcriptionTypes={{
translation: 'Translation',
transcription: 'Transcription',
Expand Down

0 comments on commit 0245a25

Please sign in to comment.