Skip to content

Commit

Permalink
#75 fixed some problem with Repository model.
Browse files Browse the repository at this point in the history
  • Loading branch information
artzub committed Feb 3, 2022
1 parent 7919ac5 commit 24cc0dd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/components/Header/components/RepositoryStep/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ const onClick = (event) => event.stopPropagation();

const Header = (props) => {
const { selected } = useSelector(slice.selectors.getState);
const { name, private: locked, fork, html_url } = selected || {};
const { name, isPrivate, isFork, url } = selected || {};

return (
<Container {...props}>
{locked ? <BookLockIcon size={20} /> : (
fork
{isPrivate ? <BookLockIcon size={20} /> : (
isFork
? <SourceRepositoryIcon size={20} />
: <BookIcon size={20} />
)}
Expand All @@ -30,7 +30,7 @@ const Header = (props) => {
<Link
target="_blank"
onClick={onClick}
href={html_url}
href={url}
title="On github"
style={{ verticalAlign: 'middle', marginRight: '3px' }}
>
Expand Down
10 changes: 6 additions & 4 deletions src/models/Repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export const Repository = ({
id,
name,
description,
defaultBranch,
url,
language,
forks = 0,
Expand All @@ -12,14 +13,15 @@ export const Repository = ({
isPrivate,
isArchived,
isLocked,
updateAt,
createAt,
updatedAt,
createdAt,
pushedAt,
...rest
}) => ({
id,
name,
description,
defaultBranch,
url,
language: language || 'multi',
forks,
Expand All @@ -30,8 +32,8 @@ export const Repository = ({
isPrivate,
isArchived,
isLocked,
updateAt,
createAt,
updatedAt,
createdAt,
pushedAt,
mics: rest,
});
4 changes: 2 additions & 2 deletions src/redux/api/github/transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const repository = (item) => Repository({
isFork: item.fork,
isArchived: item.archived,
isLocked: item.disabled,
updateAt: Date.parse(item.update_at),
createAt: Date.parse(item.create_at),
updatedAt: Date.parse(item.updated_at),
createdAt: Date.parse(item.created_at),
pushedAt: Date.parse(item.pushed_at),
});

0 comments on commit 24cc0dd

Please sign in to comment.