Skip to content

Commit

Permalink
Update component: TelescopeAvatar (size propertie)
Browse files Browse the repository at this point in the history
BannerButtons update <TelescopeAvatar>

Update <TelescopeaAvatar>:
Add blog option.

Remove `padding-top`:
 Class: postsWrapper inside <Posts>

Remove `padding-top` on mobile:
     Class: postsWrapper inside <Posts>

Banner Button ScrollDown:
Working
  • Loading branch information
PedroFonsecaDEV committed Apr 14, 2021
1 parent 896133f commit 15f0a31
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 20 deletions.
9 changes: 6 additions & 3 deletions src/web/src/components/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import KeyboardArrowDownIcon from '@material-ui/icons/KeyboardArrowDown';
import { telescopeUrl } from '../config';
import BannerDynamicItems from './BannerDynamicItems';
import LandingButtons from './BannerButtons';
import ScrollAction from './ScrollAction';

const useStyles = makeStyles((theme: Theme) =>
createStyles({
Expand Down Expand Up @@ -194,9 +195,11 @@ export default function Banner({ onVisibilityChange }: BannerProps) {
>
v {gitInfo.version}
</a>
<Fab color="primary" aria-label="scroll-down">
<KeyboardArrowDownIcon className={classes.arrowDownIcon} />
</Fab>
<ScrollAction>
<Fab color="primary" aria-label="scroll-down">
<KeyboardArrowDownIcon className={classes.arrowDownIcon} />
</Fab>
</ScrollAction>
</div>
<div className={classes.anchor} id="posts-anchor" ref={timelineAnchor} />
</>
Expand Down
2 changes: 1 addition & 1 deletion src/web/src/components/BannerButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const LandingButtons = () => {
>
Sign out
</Button>
<TelescopeAvatar name={user.name} img={user.avatarUrl} size="45" />
<TelescopeAvatar name={user.name} img={user.avatarUrl} size="40px" />
</>
) : (
<>
Expand Down
4 changes: 0 additions & 4 deletions src/web/src/components/Posts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ const useStyles = makeStyles((theme: Theme) =>
},
postsWrapper: {
width: '100%',
paddingTop: '5rem',
[theme.breakpoints.down('xs')]: {
paddingTop: '2rem',
},
},
error: {
color: '#B5B5B5',
Expand Down
32 changes: 20 additions & 12 deletions src/web/src/components/TelescopeAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { Avatar } from '@material-ui/core';

type TelescopeAvatarProps = {
name: string;
img?: string;
size: string;
img?: string;
blog?: string;
};

const getInitials = (name: string) => {
Expand All @@ -20,23 +21,30 @@ const getInitials = (name: string) => {
return initials;
};

const TelescopeAvatar = ({ name, img, size }: TelescopeAvatarProps) => {
const TelescopeAvatar = ({ name, img, size, blog }: TelescopeAvatarProps) => {
const initials = getInitials(name);

return (
<Avatar
alt={name}
src={img}
<a
href={blog}
style={{
width: size,
height: size,
fontSize: `calc(${size}px * 0.43)`,
backgroundColor: '#A0D1FB',
color: '#000',
textDecoration: 'none',
}}
>
{initials}
</Avatar>
<Avatar
alt={name}
src={img}
style={{
width: size,
height: size,
fontSize: `calc(${size} * 0.43)`,
backgroundColor: '#A0D1FB',
color: '#000',
}}
>
{initials}
</Avatar>
</a>
);
};

Expand Down

0 comments on commit 15f0a31

Please sign in to comment.