generated from idea2app/Next-Bootstrap-ts
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] Repository names in Project files
- Loading branch information
Showing
17 changed files
with
365 additions
and
103 deletions.
There are no files selected for viewing
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
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
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,75 @@ | ||
import { Icon, Nameplate, text2color } from 'idea-react'; | ||
import { marked } from 'marked'; | ||
import { FC } from 'react'; | ||
import { Badge, Card, CardProps, Stack } from 'react-bootstrap'; | ||
|
||
import { Issue } from '../../../models/Repository'; | ||
|
||
export type IssueCardProps = Issue & Omit<CardProps, 'id' | 'body'>; | ||
|
||
export const IssueCard: FC<IssueCardProps> = ({ | ||
bg = 'light', | ||
text = 'dark', | ||
id, | ||
number, | ||
title, | ||
labels, | ||
body, | ||
html_url, | ||
user, | ||
comments, | ||
created_at, | ||
...props | ||
}) => ( | ||
<Card {...{ ...props, bg, text }}> | ||
<Card.Header | ||
as="h4" | ||
className="d-flex justify-content-between align-items-center gap-3" | ||
> | ||
<a | ||
className="text-decoration-none text-secondary text-truncate" | ||
title={title} | ||
href={html_url} | ||
target="_blank" | ||
rel="noreferrer" | ||
> | ||
#{number} {title} | ||
</a> | ||
<Stack direction="horizontal" gap={2}> | ||
{labels.map( | ||
label => | ||
typeof label === 'object' && ( | ||
<Badge | ||
key={label.name} | ||
className="fs-6" | ||
{...(label.color | ||
? { | ||
bg: '', | ||
style: { background: `#${label.color}` }, | ||
} | ||
: { | ||
bg: text2color(label.name || '', ['light']), | ||
})} | ||
> | ||
{label.name} | ||
</Badge> | ||
), | ||
)} | ||
</Stack> | ||
</Card.Header> | ||
<Card.Body | ||
as="article" | ||
dangerouslySetInnerHTML={{ __html: marked(body || '') }} | ||
/> | ||
<Card.Footer className="d-flex justify-content-between align-items-center"> | ||
{user && <Nameplate name={user.name || ''} avatar={user.avatar_url} />} | ||
|
||
<Stack direction="horizontal" gap={2}> | ||
<Icon name="chat-left-text" /> | ||
{comments} | ||
</Stack> | ||
|
||
<time dateTime={created_at}>{new Date(created_at).toLocaleString()}</time> | ||
</Card.Footer> | ||
</Card> | ||
); |
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,53 @@ | ||
import { Icon, text2color } from 'idea-react'; | ||
import { FC, useState } from 'react'; | ||
import { Badge, Card, Col, Collapse, Row } from 'react-bootstrap'; | ||
|
||
import type { GitRepository } from '../../../models/Repository'; | ||
import { IssueCard } from './Card'; | ||
|
||
export const IssueModule: FC<GitRepository> = ({ name, language, issues }) => { | ||
const [isExpand, setIsExpand] = useState(false); | ||
|
||
return ( | ||
<Card className="p-0" bg="light" text="dark"> | ||
<Card.Header | ||
className="cursor-pointer" | ||
onClick={() => setIsExpand(!isExpand)} | ||
> | ||
<Row className="align-items-center gx-3"> | ||
<Col xs={4} sm={2}> | ||
{language && ( | ||
<Badge className="fs-6" bg={text2color(language, ['light'])}> | ||
{language} | ||
</Badge> | ||
)} | ||
</Col> | ||
<Col xs={6} sm={8} as="h3" className="m-0 text-truncate"> | ||
{name} | ||
</Col> | ||
<Col xs={1} className="text-end"> | ||
<Badge className="fs-6" pill bg="info"> | ||
{issues.length} | ||
</Badge> | ||
</Col> | ||
<Col xs={1} className="text-end"> | ||
<Icon | ||
size={1.5} | ||
name={isExpand ? 'arrows-collapse' : 'arrows-expand'} | ||
/> | ||
</Col> | ||
</Row> | ||
</Card.Header> | ||
|
||
<Collapse in={isExpand}> | ||
<Card.Body as={Row} xs={1} sm={2} xl={2} className="g-3"> | ||
{issues.map(issue => ( | ||
<Col key={issue.title}> | ||
<IssueCard className="h-100" {...issue} /> | ||
</Col> | ||
))} | ||
</Card.Body> | ||
</Collapse> | ||
</Card> | ||
); | ||
}; |
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
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
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
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
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
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,3 @@ | ||
import { proxyGithub } from './core'; | ||
|
||
export default proxyGithub(); |
Oops, something went wrong.
128e713
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for oss-toolbox ready!
✅ Preview
https://oss-toolbox-g1bxsvnkx-techquery.vercel.app
Built with commit 128e713.
This pull request is being automatically deployed with vercel-action