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

Adjust titles when selecting drawer #1435

Merged
merged 9 commits into from
Apr 15, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export function EditorTitleBar() {
const [editMode, setEditMode] = useState(false);
const [title, setTitle] = useState<string>(yaptideEditor?.config.getKey('project/title'));
const titleRef = useRef(title);
useDocumentTitle(titleRef.current);
grzanka marked this conversation as resolved.
Show resolved Hide resolved

const startSave = useCallback(() => {
setSaving(true);
Expand Down
12 changes: 12 additions & 0 deletions src/WrapperApp/WrapperApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ function WrapperApp() {
if (isAuthorized && tabsValue === 'login') setTabsValue('editor');
}, [isAuthorized, tabsValue]);

useEffect(() => {
const tabTitles = {
login: 'Login',
editor: 'Editor',
inputFiles: 'Input files',
simulations: 'Simulations',
results: 'Results',
about: 'About'
};
document.title = `${tabTitles[tabsValue as keyof typeof tabTitles] || 'Yaptide'}`;
}, [tabsValue]);

return (
<Box
sx={{
Expand Down
Loading