Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

website: Update avatar documentation & demos #963

Merged
merged 10 commits into from
Feb 8, 2023

Conversation

FlyersPh9
Copy link
Collaborator

@FlyersPh9 FlyersPh9 commented Jan 6, 2023

  • Add avatar demos for the different options.
  • Update documentation, include adding hyperlinks to other mentioned components.

@FlyersPh9 FlyersPh9 added the documentation Improvements or additions to documentation label Jan 6, 2023
@FlyersPh9 FlyersPh9 self-assigned this Jan 6, 2023
@FlyersPh9 FlyersPh9 changed the title Initial push. website: Update avatar documentation & demos Jan 6, 2023
@FlyersPh9
Copy link
Collaborator Author

Once #1040 merges, this will get unblocked.

<Avatar
abbreviation='GB'
backgroundColor={getUserColor('Greg Bentley')}
image={<img src='https://www.bentley.com/wp-content/uploads/greg-bentley-hr-profile.jpeg' />}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Where can I host an image to use instead of this one from bentley.com? I don't want to use https://itwin.github.io/iTwinUI/css/assets/user-placeholder.png because it looks too close to the SVG examples.

Copy link
Contributor

@mayank99 mayank99 Feb 7, 2023

Choose a reason for hiding this comment

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

you can put it in the public folder under apps/website and it should be available at this url: https://itwinui.bentley.com/<your-file-name.jpg> (after it's deployed)

if you decide to do this, i would recommend not using a human face (even if it's AI-generated). Instead, you could use something like this: https://stock.adobe.com/search?k=robot+avatar&asset_id=359684982

Copy link
Contributor

Choose a reason for hiding this comment

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

oh i just realized this is for the demos. we probably don't want to show the full domain in the code, so what you really need is to put an image inside the sandbox.

there might be cleaner ways of doing this, but one easy option is to convert it to a data uri and use it in the src attribute of the img.

<img src='data:image/...'>

the url is not the focus, so it gets the point across (that you can use an tag)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good suggestion, replaced with that robot & used a data URI.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh wow that url is incredibly long. maybe move it out to a variable

const imgSrc = `data:image/...`;
<img src={imgSrc} />

Copy link
Contributor

Choose a reason for hiding this comment

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

move it out to a variable

bump

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just pushed this change, let me know if I did it right.

Copy link
Contributor

Choose a reason for hiding this comment

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

looks good

@FlyersPh9 FlyersPh9 marked this pull request as ready for review February 7, 2023 16:07
@FlyersPh9 FlyersPh9 requested a review from a team as a code owner February 7, 2023 16:07
@FlyersPh9 FlyersPh9 requested review from a team, mayank99 and r100-stack and removed request for a team February 7, 2023 16:07
@FlyersPh9 FlyersPh9 enabled auto-merge February 8, 2023 17:13
@FlyersPh9 FlyersPh9 disabled auto-merge February 8, 2023 17:14
@mayank99 mayank99 enabled auto-merge February 8, 2023 17:16
@mayank99 mayank99 added this pull request to the merge queue Feb 8, 2023
@mayank99 mayank99 removed this pull request from the merge queue due to a manual request Feb 8, 2023
@mayank99 mayank99 added this pull request to the merge queue Feb 8, 2023
Merged via the queue into main with commit e7a3c80 Feb 8, 2023
@mayank99 mayank99 deleted the jon/documentation-site-avatar branch February 8, 2023 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants