-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'the-kingdoms:develop' into develop
- Loading branch information
Showing
10 changed files
with
160 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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,23 @@ | ||
import { platformAtom } from "@/data/platform"; | ||
import { postAppleLogin } from "@/libs/reactNative/sender"; | ||
import LoginButton from "@modules/components/button/LoginButton"; | ||
import FlexBox from "@modules/layout/FlexBox"; | ||
import { useAtom } from "jotai"; | ||
|
||
function AppleLoginButtonWrapper() { | ||
const [platform] = useAtom(platformAtom); | ||
const appleLogin = () => { | ||
postAppleLogin(); | ||
}; | ||
return ( | ||
<FlexBox className="px-4 w-full justify-center"> | ||
{platform?.OS === "ios" && ( | ||
<div className="w-full max-w-[360px]"> | ||
<LoginButton type="apple" onClick={appleLogin} /> | ||
</div> | ||
)} | ||
</FlexBox> | ||
); | ||
} | ||
|
||
export default AppleLoginButtonWrapper; |
This file contains 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
File renamed without changes.
This file contains 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,93 @@ | ||
import { atom } from "jotai"; | ||
|
||
export type PlatformOSType = | ||
| "ios" | ||
| "android" | ||
| "macos" | ||
| "windows" | ||
| "web" | ||
| "native"; | ||
type PlatformConstants = { | ||
isTesting: boolean; | ||
reactNativeVersion: { | ||
major: number; | ||
minor: number; | ||
patch: number; | ||
prerelease?: number | null | undefined; | ||
}; | ||
}; | ||
interface PlatformStatic { | ||
isTV: boolean; | ||
isTesting: boolean; | ||
Version: number | string; | ||
constants: PlatformConstants; | ||
|
||
/** | ||
* @see https://reactnative.dev/docs/platform-specific-code#content | ||
*/ | ||
select<T>( | ||
specifics: | ||
| ({ [platform in PlatformOSType]?: T } & { default: T }) | ||
| { [platform in PlatformOSType]: T }, | ||
): T; | ||
select<T>(specifics: { [platform in PlatformOSType]?: T }): T | undefined; | ||
} | ||
|
||
interface PlatformIOSStatic extends PlatformStatic { | ||
constants: PlatformConstants & { | ||
forceTouchAvailable: boolean; | ||
interfaceIdiom: string; | ||
osVersion: string; | ||
systemName: string; | ||
}; | ||
OS: "ios"; | ||
isPad: boolean; | ||
isTV: boolean; | ||
Version: string; | ||
} | ||
|
||
interface PlatformAndroidStatic extends PlatformStatic { | ||
constants: PlatformConstants & { | ||
Version: number; | ||
Release: string; | ||
Serial: string; | ||
Fingerprint: string; | ||
Model: string; | ||
Brand: string; | ||
Manufacturer: string; | ||
ServerHost?: string | undefined; | ||
uiMode: "car" | "desk" | "normal" | "tv" | "watch" | "unknown"; | ||
}; | ||
OS: "android"; | ||
Version: number; | ||
} | ||
|
||
interface PlatformMacOSStatic extends PlatformStatic { | ||
OS: "macos"; | ||
Version: string; | ||
constants: PlatformConstants & { | ||
osVersion: string; | ||
}; | ||
} | ||
|
||
interface PlatformWindowsOSStatic extends PlatformStatic { | ||
OS: "windows"; | ||
Version: number; | ||
constants: PlatformConstants & { | ||
osVersion: number; | ||
}; | ||
} | ||
|
||
interface PlatformWebStatic extends PlatformStatic { | ||
OS: "web"; | ||
} | ||
|
||
export type Platform = | ||
| PlatformIOSStatic | ||
| PlatformAndroidStatic | ||
| PlatformWindowsOSStatic | ||
| PlatformMacOSStatic | ||
| PlatformWebStatic; | ||
|
||
export const platformAtom = atom<Platform | null>(null); | ||
platformAtom.debugLabel = "platformAtom"; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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