Closed SeamusY closed 2 years ago
At first glance it appears the issues is you could be mixing 2 versions of Amplify UI components @aws-amplify/ui-react
and aws-amplify-react
packages, which have different theming mechanisms.
Originally i stuck with the “aws-amplify-react” which i dug into library, but still looking at the structure… it wasn’t clear how to pass. Upon stack overflow, most of them follow the structure i was given using themeAtp1
Yours Faithfully, S
On 25 Jan 2022, at 17:38, Danny Banks @.***> wrote:
At first glance it appears the issues is you could be mixing 2 versions of Amplify UI components @aws-amplify/ui-react and aws-amplify-react packages, which have different theming mechanisms.
— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.
Hello @SeamusY, for clarity we're mixing up three versions:
aws-amplify-amplify
's PhotoPicker
/ Picker
. This is the one you're using, and it's no longer maintained.@aws-amplify/ui-react@v1
's PhotoPicker
. This is the last working version we supported. @aws-amplify/ui-react@v2
was just released last November. This adds AmplifyProvider
, primitives, and Authenticator
but not ImagePicker
yet.<Picker />
from (1) will not work with (3) as @dbanksdesign mentioned.
For now, you can either stick to (1) and (2) and theme it yourself. I suggest sticking to (1) because i recall it being more customizable than (2).
For more resilient solution, please consider opening a feature request to this repo for Picker
support in latest @aws-amplify/ui-react
(3). We would love to bridge this gap and provide first class support for S3 components like we did for Authenticator.
Ok, for now. I prefer sticking to (1) any idea on how to customise it?? Ill put in a feature request in (3) later. We may move things to that later to avoid no longer maintained libraries.
Yours Faithfully, Seamus Yeo
On 25 Jan 2022, at 18:28, William Lee @.***> wrote:
Hello @SeamusY, for clarity we're mixing up three versions:
aws-amplify-amplify's PhotoPicker / Picker. This is the one you're using, and it's no longer maintained. @@.'s PhotoPicker. This is the last working version we supported. @@. was just released last November. This adds AmplifyProvider, primitives, and Authenticator but not ImagePicker yet.
from (1) will not work with (3) as @dbanksdesign mentioned. For now, you can either stick to (1) and (2) and theme it yourself. I suggest sticking to (1) because i recall it being more customizable than (2).
For more resilient solution, please consider opening a feature request to this repo for Picker support in latest @aws-amplify/ui-react (3). We would love to bridge this gap and provide first class support for S3 components like we did for Authenticator.
— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.
I don't think (1) is covered in shadow dom or anything, so you are able to target them directly with CSS along with some className
tricks.
For example, I could customize the button here:
https://codesandbox.io/s/legacy-picker-customization-jq7wz?file=/src/App.js
I tried applying class name and css on top, it seems the library doesn’t take anything but amplifyTheme. Which i was confused by the structure. Even applying style directly doesn’t apply either.
Yours Faithfully, Seamus Yeo
On 25 Jan 2022, at 19:43, William Lee @.***> wrote:
I don't think (1) is covered in shadow dom or anything, so you should be able to target them directly with CSS along with some className tricks.
For example, I could customize the button here:
https://codesandbox.io/s/legacy-picker-customization-jq7wz?file=/src/App.js
— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.
Hmm, have you checked out the codesandbox above? I could get the embedded button to change colors/paddings/etc.
You shouldn't need to even deal with amplifyTheme
for the picker.
My css file for that codesandbox is here: https://codesandbox.io/s/legacy-picker-customization-jq7wz?file=/src/styles.css
It worked thank you! @wlee221, i suppose the reason this worked is you targeted the parent and then just looked for the first button right?
Sounds good. And correct, I tried <Picker className="my-picker" />
first but that didn't work because Picker
doesn't pass down the props to its wrapper.
With that, I'll close this issue but please let us know if you find more issues!
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
Not applicable
Amplify Categories
Not applicable
Environment information
Describe the bug
I have attempted to provide a theme to the component, however... the default amazonOrange overrides my theme provided.
Expected behavior
I expect that the theme would enable the background colour of the button to appear as "Blue"
Reproduction steps
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots