- Notifications
You must be signed in to change notification settings - Fork279
Take the latest changes from Raheel#534
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
12 commits Select commitHold shift + click to select a range
fd314d4
Merge pull request #529 from lowcoder-org/feat/Layout-Mode
FalkWolskyd000d85
feat: added screenInfo hook
raheeliftikhar514e8dc2
Merge pull request #531 from raheeliftikhar5/screen-info-hook
FalkWolskyae91db0
refactor: handle redirectUrl using sessionStoragee
raheeliftikhar527019d1
refactor: use redirectUrl from sessionStorage
raheeliftikhar585c0499
Merge branch 'dev' into refactor-redirect
FalkWolsky436283f
feat: foldable components sections
raheeliftikhar56e080c6
fix: initially show only commonly used comps
raheeliftikhar5ad2e97e
fix: show border bottom for each section
raheeliftikhar55e065a7
Merge pull request #532 from raheeliftikhar5/refactor-redirect
FalkWolsky5fc8cdd
Merge branch 'dev' into foldable-comps-sections
FalkWolskyb4e12f2
Merge pull request #533 from raheeliftikhar5/foldable-comps-sections
FalkWolskyFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
9 changes: 6 additions & 3 deletionsclient/packages/lowcoder/src/appView/AppViewInstance.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletionsclient/packages/lowcoder/src/comps/hooks/hookComp.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletionsclient/packages/lowcoder/src/comps/hooks/hookCompTypes.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletionsclient/packages/lowcoder/src/comps/hooks/hookListComp.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletionsclient/packages/lowcoder/src/comps/hooks/screenInfoComp.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { useCallback, useEffect, useState } from "react"; | ||
import { hookToStateComp } from "../generators/hookToComp"; | ||
enum ScreenTypes { | ||
Mobile = 'mobile', | ||
Tablet = 'tablet', | ||
Desktop = 'desktop', | ||
} | ||
type ScreenType = typeof ScreenTypes[keyof typeof ScreenTypes] | ||
type ScreenInfo = { | ||
width?: number; | ||
height?: number; | ||
deviceType?: ScreenType; | ||
isDesktop?: boolean; | ||
isTablet?: boolean; | ||
isMobile?: boolean; | ||
} | ||
function useScreenInfo() { | ||
const getDeviceType = () => { | ||
if (window.screen.width < 768) return ScreenTypes.Mobile; | ||
if (window.screen.width < 889) return ScreenTypes.Tablet; | ||
return ScreenTypes.Desktop; | ||
} | ||
const getFlagsByDeviceType = (deviceType: ScreenType) => { | ||
const flags = { | ||
isMobile: false, | ||
isTablet: false, | ||
isDesktop: false, | ||
}; | ||
if(deviceType === ScreenTypes.Mobile) { | ||
return { ...flags, isMobile: true }; | ||
} | ||
if(deviceType === ScreenTypes.Tablet) { | ||
return { ...flags, Tablet: true }; | ||
} | ||
return { ...flags, isDesktop: true }; | ||
} | ||
const getScreenInfo = useCallback(() => { | ||
const { width, height } = window.screen; | ||
const deviceType = getDeviceType(); | ||
const flags = getFlagsByDeviceType(deviceType); | ||
return { width, height, deviceType, ...flags }; | ||
}, []) | ||
const [screenInfo, setScreenInfo] = useState<ScreenInfo>({}); | ||
const updateScreenInfo = useCallback(() => { | ||
setScreenInfo(getScreenInfo()); | ||
}, [getScreenInfo]) | ||
useEffect(() => { | ||
window.addEventListener('resize', updateScreenInfo); | ||
updateScreenInfo(); | ||
return () => window.removeEventListener('resize', updateScreenInfo); | ||
}, [ updateScreenInfo ]) | ||
return screenInfo; | ||
} | ||
export const ScreenInfoHookComp = hookToStateComp(useScreenInfo); |
11 changes: 8 additions & 3 deletionsclient/packages/lowcoder/src/constants/authConstants.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletionclient/packages/lowcoder/src/constants/routesURL.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
109 changes: 75 additions & 34 deletionsclient/packages/lowcoder/src/pages/editor/right/uiCompPanel.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
27 changes: 20 additions & 7 deletionsclient/packages/lowcoder/src/pages/userAuth/authUtils.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletionclient/packages/lowcoder/src/pages/userAuth/index.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion...nt/packages/lowcoder/src/pages/userAuth/thirdParty/authenticator/abstractAuthenticator.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.