-
-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[account] New slots and sub-components (#4181)
- Loading branch information
1 parent
cb458c2
commit 45d2188
Showing
52 changed files
with
2,761 additions
and
750 deletions.
There are no files selected for viewing
127 changes: 0 additions & 127 deletions
127
docs/data/toolpad/core/components/account/AccountCustom.js
This file was deleted.
Oops, something went wrong.
133 changes: 0 additions & 133 deletions
133
docs/data/toolpad/core/components/account/AccountCustom.tsx
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
docs/data/toolpad/core/components/account/AccountCustom.tsx.preview
This file was deleted.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
docs/data/toolpad/core/components/account/AccountCustomLocaleText.js
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,47 @@ | ||
import * as React from 'react'; | ||
import { AuthenticationContext, SessionContext } from '@toolpad/core/AppProvider'; | ||
import { Account } from '@toolpad/core/Account'; | ||
|
||
const demoSession = { | ||
user: { | ||
name: 'Bharat Kashyap', | ||
email: '[email protected]', | ||
image: 'https://avatars.githubusercontent.com/u/19550456', | ||
}, | ||
}; | ||
|
||
export default function AccountCustomLocaleText() { | ||
const [session, setSession] = React.useState(demoSession); | ||
|
||
const authentication = React.useMemo(() => { | ||
return { | ||
signIn: () => { | ||
setSession({ | ||
user: { | ||
name: 'Bharat Kashyap', | ||
email: '[email protected]', | ||
image: 'https://avatars.githubusercontent.com/u/19550456', | ||
}, | ||
}); | ||
}, | ||
signOut: () => { | ||
setSession(null); | ||
}, | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<AuthenticationContext.Provider value={authentication}> | ||
<SessionContext.Provider value={session}> | ||
{/* preview-start */} | ||
<Account | ||
localeText={{ | ||
signInLabel: 'लॉग इन', | ||
signOutLabel: 'लॉग आउट', | ||
}} | ||
/> | ||
{/* preview-end */} | ||
</SessionContext.Provider> | ||
</AuthenticationContext.Provider> | ||
); | ||
} |
51 changes: 51 additions & 0 deletions
51
docs/data/toolpad/core/components/account/AccountCustomLocaleText.tsx
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,51 @@ | ||
import * as React from 'react'; | ||
import { | ||
AuthenticationContext, | ||
Session, | ||
SessionContext, | ||
} from '@toolpad/core/AppProvider'; | ||
import { Account } from '@toolpad/core/Account'; | ||
|
||
const demoSession = { | ||
user: { | ||
name: 'Bharat Kashyap', | ||
email: '[email protected]', | ||
image: 'https://avatars.githubusercontent.com/u/19550456', | ||
}, | ||
}; | ||
|
||
export default function AccountCustomLocaleText() { | ||
const [session, setSession] = React.useState<Session | null>(demoSession); | ||
|
||
const authentication = React.useMemo(() => { | ||
return { | ||
signIn: () => { | ||
setSession({ | ||
user: { | ||
name: 'Bharat Kashyap', | ||
email: '[email protected]', | ||
image: 'https://avatars.githubusercontent.com/u/19550456', | ||
}, | ||
}); | ||
}, | ||
signOut: () => { | ||
setSession(null); | ||
}, | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<AuthenticationContext.Provider value={authentication}> | ||
<SessionContext.Provider value={session}> | ||
{/* preview-start */} | ||
<Account | ||
localeText={{ | ||
signInLabel: 'लॉग इन', | ||
signOutLabel: 'लॉग आउट', | ||
}} | ||
/> | ||
{/* preview-end */} | ||
</SessionContext.Provider> | ||
</AuthenticationContext.Provider> | ||
); | ||
} |
6 changes: 6 additions & 0 deletions
6
docs/data/toolpad/core/components/account/AccountCustomLocaleText.tsx.preview
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,6 @@ | ||
<Account | ||
localeText={{ | ||
signInLabel: 'लॉग इन', | ||
signOutLabel: 'लॉग आउट', | ||
}} | ||
/> |
Oops, something went wrong.