Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved handling of state change for image/transcription view components #16

Merged
merged 11 commits into from
May 17, 2024
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