Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into tree-view
Browse files Browse the repository at this point in the history
  • Loading branch information
vocksel committed Dec 9, 2024
2 parents 39dc0cc + 56e3e95 commit 3305e7c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/Navigation/Screen.luau
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local Storyteller = require("@pkg/Storyteller")

local AboutView = require("@root/About/AboutView")
local NavigationContext = require("@root/Navigation/NavigationContext")
local NoStorySelected = require("@root/Storybook/NoStorySelected")
local SettingsView = require("@root/UserSettings/SettingsView")
local StoryCanvas = require("@root/Storybook/StoryCanvas")

Expand All @@ -30,6 +31,8 @@ local function Screen(props: Props)
story = props.story,
storybook = props.storybook,
})
else
return React.createElement(NoStorySelected)
end
elseif currentScreen == "Settings" then
return React.createElement(SettingsView)
Expand Down
16 changes: 12 additions & 4 deletions src/Panels/Topbar.luau
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,20 @@ local function Topbar(props: Props)
local navigation = NavigationContext.use()

local navigateToSettings = useCallback(function()
navigation.navigateTo("Settings")
end, { navigation.navigateTo })
if navigation.currentScreen ~= "Settings" then
navigation.navigateTo("Settings")
else
navigation.navigateTo("Home")
end
end, { navigation.navigateTo, navigation.currentScreen } :: { unknown })

local navigateToAbout = useCallback(function()
navigation.navigateTo("About")
end, { navigation.navigateTo })
if navigation.currentScreen ~= "About" then
navigation.navigateTo("About")
else
navigation.navigateTo("Home")
end
end, { navigation.navigateTo, navigation.currentScreen } :: { unknown })

return React.createElement("Frame", {
BackgroundColor3 = theme.sidebar,
Expand Down
3 changes: 0 additions & 3 deletions src/Storybook/StoryCanvas.luau
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ local ModuleLoader = require("@pkg/ModuleLoader")
local React = require("@pkg/React")
local Storyteller = require("@pkg/Storyteller")

local NoStorySelected = require("@root/Storybook/NoStorySelected")
local StoryView = require("@root/Storybook/StoryView")
local useTheme = require("@root/Common/useTheme")

Expand Down Expand Up @@ -48,8 +47,6 @@ local function Canvas(props: Props)
story = props.story,
storybook = props.storybook,
}),

NoStorySelected = not props.story and e(NoStorySelected),
}),
})
end
Expand Down

0 comments on commit 3305e7c

Please sign in to comment.