Skip to content

[BA-2338] Sign in with Base button Preact + React#5

Closed
fan-zhang-sv wants to merge 16 commits into
masterfrom
felix/buttons
Closed

[BA-2338] Sign in with Base button Preact + React#5
fan-zhang-sv wants to merge 16 commits into
masterfrom
felix/buttons

Conversation

@fan-zhang-sv
Copy link
Copy Markdown
Collaborator

@fan-zhang-sv fan-zhang-sv commented Jun 30, 2025

Summary

  • added pre-styled sign in with Base button for Preact and react

How did you test your changes?

image

@fan-zhang-sv fan-zhang-sv changed the title account-sdk-ui [BA-2338] Sign in with Base button Preact + React Jun 30, 2025
@linear
Copy link
Copy Markdown

linear Bot commented Jun 30, 2025

@fan-zhang-sv fan-zhang-sv marked this pull request as ready for review June 30, 2025 23:35
Base automatically changed from felix/new-structure to master July 1, 2025 16:41
@cb-heimdall
Copy link
Copy Markdown
Collaborator

cb-heimdall commented Jul 1, 2025

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@fan-zhang-sv fan-zhang-sv requested review from arjun-dureja, cb-jake, lukasrosario and stephancill and removed request for lukasrosario July 1, 2025 16:43
"typescript": "^5.1.6",
"vitest": "^2.1.9"
},
"peerDependencies": {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the plan to support other frameworks? if so we should either name this package based on react or use exports to export the react components vs vue, etc..

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya, the plan is to create wrapper for vue, svelte, etc, just this PR only focus on preact and react wrapper

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use package.json>exports for each package then

// biome-ignore lint/correctness/noUnusedImports: preact
import { h } from 'preact';

export const TheSquare = ({ darkMode }: { darkMode: boolean }) => (
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is the base logo we should call it that vs something that is esoteric

Comment thread packages/account-sdk-ui/src/components/preact/SignInWithBaseButton.tsx Outdated
Comment on lines +46 to +49
const LIGHT_MODE_BOARDER = '#1E2025';
const DARK_MODE_BOARDER = '#282B31';
const WHITE = '#FFF';
const BLACK = '#000';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe move this to a constants file that could be used by other ui libraries

@@ -0,0 +1,14 @@
// biome-ignore lint/correctness/noUnusedImports: preact
import { h } from 'preact';
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is being consumed by preact implementation

Comment thread packages/account-sdk-ui/src/index.ts Outdated
export type { SignInWithBaseButtonProps } from './types.js';

// Preact components
export { SignInWithBaseButton as PreactSignInWithBaseButton } from './components/preact/SignInWithBaseButton.js';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use separate export paths. i.e https://nodejs.org/api/packages.html#exports

Comment thread packages/account-sdk-ui/src/types.ts Outdated
export type SignInWithBaseButtonProps = {
centered?: boolean;
transparent?: boolean;
darkMode?: boolean;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think colorScheme is a bit more scalable long term.

Comment thread packages/account-sdk-ui/package.json Outdated
"web3"
],
"type": "module",
"exports": {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

much better

Copy link
Copy Markdown
Collaborator

@cb-jake cb-jake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. Just a nit on directory structure. What are your thoughts

@fan-zhang-sv
Copy link
Copy Markdown
Collaborator Author

created a new one here #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants