Comments (2)
Here is my updated code with support for query parameters (i may serve images through a cdn that needs query params to retrieve proper sizes)
import React, { FunctionComponent } from "react";
import { Tag } from "coral-ui/components/v2";
interface Props {
badges: ReadonlyArray<string>;
className?: string;
}
const AuthorBadges: FunctionComponent<Props> = ({ badges, className }) => (
<>
{badges.map((badge) => {
if (/^https?:\/\/.*\.(?:png|jpg|jpeg|gif)(\?.*)?$/i.test(badge)) {
className = className + " flairBadge"
return (
<Tag key={badge} color="dark" className={className}>
<img src={badge} />
</Tag>
)
}
else {
return (
<Tag key={badge} color="dark" className={className}>
{badge}
</Tag>);
}
})}
</>
);
export default AuthorBadges;
from talk.
Hi there, thanks for the suggestion, we'll add to our backlog.
from talk.
Related Issues (20)
- Story title not available HOT 1
- CORS Error When Clicking Email Verification Button HOT 3
- Position fixed leads to gaps in the comment stream HOT 3
- Long comments trigger Slack error HOT 3
- Comments are not loading when scrolling HOT 8
- New commenter approval: Bug or is this As Designed? HOT 4
- broken link in docs HOT 2
- Client Theme Builder GUI HOT 1
- Moderation is broken with 8.6.0 HOT 4
- GDPR - actively clean up rejected comments older than 1 year HOT 4
- DSA Anonymous Reporting HOT 7
- Errors that seem to have no effect HOT 1
- INTERNAL_ERROR: Text record must only set "authSource" or "replicaSet"` HOT 1
- Support for Hostnames without TLD in "Site permitted domains" HOT 2
- OpenID Connect HTTP Callback Url HOT 3
- Adding unnecessary padding when trying to render commenting thread in a modal HOT 5
- Error while upgrading from 7.3.0 to 8.0.0 HOT 8
- Finnish translation: Notification email footer issues HOT 3
- Expand visible dashboard data to weekly/monthly HOT 1
- Story cache - DATA_CACHING_NOT_AVAILABLE HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from talk.