-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
37125d6
commit 98d2e04
Showing
20 changed files
with
340 additions
and
40 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 @@ | ||
pod 'FLEX', :configurations => ['Debug'] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,36 @@ | ||
import { useRouter } from "../router"; | ||
import { useRouter } from '../router'; | ||
|
||
export const Settings = () => { | ||
const router = useRouter(); | ||
return ( | ||
<> | ||
<actionbar title="About" /> | ||
<gridlayout rows="*,auto,auto,*"> | ||
|
||
<actionbar title="About" className="bg-sky-800 text-white" /> | ||
{/* rows="*,auto,auto,*" */} | ||
<stacklayout className="h-full"> | ||
<label | ||
className={`text-5xl font-thin uppercase my-16 text-center ${global.isVisionOS ? 'text-white' : 'text-sky-700'}`} | ||
> | ||
About Page | ||
</label> | ||
<button | ||
row="1" | ||
row="1" | ||
text="Go to Home" | ||
on:tap={() => { | ||
router.goBack(); | ||
}} | ||
className="rounded-full bg-blue-500 text-white w-[300] p-3 text-2xl font-bold text-center capitalize" | ||
/> | ||
<image | ||
rowSpan="4" | ||
src="~/assets/solid.png" | ||
width="200" | ||
height="200" | ||
className="align-bottom mb-8" | ||
sharedTransitionTag="logo" | ||
/> | ||
</gridlayout> | ||
<gridlayout rows="*,auto" className="align-bottom"> | ||
<image | ||
src="~/assets/solid.png" | ||
width="300" | ||
height="300" | ||
row={1} | ||
className="align-bottom mb-8" | ||
sharedTransitionTag="logo" | ||
/> | ||
</gridlayout> | ||
</stacklayout> | ||
</> | ||
); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,33 @@ | ||
export function Button({ onTap, ...props }: { onTap: () => void }) { | ||
return <button onClick={onTap} on:tap={onTap} {...props} />; | ||
/** | ||
* Option B | ||
*/ | ||
// export function Button({ onTap, ...props }: { onTap: () => void }) { | ||
// return <button onClick={onTap} on:tap={onTap} {...props} />; | ||
// } | ||
|
||
/** | ||
* Option A | ||
*/ | ||
import { isNativeScript } from '@solid-x-platforms/utils'; | ||
export function Button({ | ||
onTap, | ||
children, | ||
...extraProps | ||
}: { | ||
onTap: () => void; | ||
children: any; | ||
}) { | ||
if (isNativeScript()) { | ||
return ( | ||
<button on:tap={onTap} {...extraProps}> | ||
{...children} | ||
</button> | ||
); | ||
} else { | ||
return ( | ||
<button onClick={onTap} {...extraProps}> | ||
{...children} | ||
</button> | ||
); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"extends": ["../../.eslintrc.json"], | ||
"ignorePatterns": ["!**/*"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.json"], | ||
"parser": "jsonc-eslint-parser", | ||
"rules": { | ||
"@nx/dependency-checks": [ | ||
"error", | ||
{ | ||
"ignoredFiles": ["{projectRoot}/vite.config.{js,ts,mjs,mts}"] | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} |
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,11 @@ | ||
# packages/utils | ||
|
||
This library was generated with [Nx](https://nx.dev). | ||
|
||
## Building | ||
|
||
Run `nx build packages/utils` to build the library. | ||
|
||
## Running unit tests | ||
|
||
Run `nx test packages/utils` to execute the unit tests via [Jest](https://jestjs.io). |
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,10 @@ | ||
{ | ||
"name": "@solid-x-platforms/utils", | ||
"version": "0.0.1", | ||
"dependencies": { | ||
"tslib": "^2.3.0" | ||
}, | ||
"type": "commonjs", | ||
"main": "./src/index.js", | ||
"typings": "./src/index.d.ts" | ||
} |
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,37 @@ | ||
{ | ||
"name": "utils", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "packages/utils/src", | ||
"projectType": "library", | ||
"targets": { | ||
"build": { | ||
"executor": "@nx/js:tsc", | ||
"outputs": ["{options.outputPath}"], | ||
"options": { | ||
"outputPath": "dist/packages/utils", | ||
"main": "packages/utils/src/index.ts", | ||
"tsConfig": "packages/utils/tsconfig.lib.json", | ||
"assets": ["packages/utils/*.md"] | ||
} | ||
}, | ||
"lint": { | ||
"executor": "@nx/eslint:lint", | ||
"outputs": ["{options.outputFile}"], | ||
"options": { | ||
"lintFilePatterns": [ | ||
"packages/utils/**/*.ts", | ||
"packages/utils/package.json" | ||
] | ||
} | ||
}, | ||
"test": { | ||
"executor": "@nx/vite:test", | ||
"outputs": ["{options.reportsDirectory}"], | ||
"options": { | ||
"passWithNoTests": true, | ||
"reportsDirectory": "../../coverage/packages/utils" | ||
} | ||
} | ||
}, | ||
"tags": [] | ||
} |
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 @@ | ||
export * from './lib/utils'; |
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,13 @@ | ||
import { isAndroid, isIOS, isNativeScript } from './utils'; | ||
|
||
describe('NativeScript Utilities', () => { | ||
it('standard web: isAndroid', () => { | ||
expect(isAndroid()).toBe(false); | ||
}); | ||
it('standard web: isIOS', () => { | ||
expect(isIOS()).toBe(false); | ||
}); | ||
it('standard web: isNativeScript', () => { | ||
expect(isNativeScript()).toBe(false); | ||
}); | ||
}); |
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,26 @@ | ||
/** | ||
* NativeScript helpers | ||
*/ | ||
|
||
/** | ||
* Determine if running on native iOS mobile app | ||
*/ | ||
export function isIOS() { | ||
return typeof NSObject !== 'undefined' && typeof NSString !== 'undefined'; | ||
} | ||
|
||
/** | ||
* Determine if running on native Android mobile app | ||
*/ | ||
export function isAndroid() { | ||
return typeof android !== 'undefined' && typeof java !== 'undefined'; | ||
} | ||
|
||
/** | ||
* Determine if running on native iOS or Android mobile app | ||
*/ | ||
export function isNativeScript() { | ||
return isIOS() || isAndroid(); | ||
} | ||
|
||
declare var NSObject: any, NSString: any, android: any, java: any; |
Oops, something went wrong.