Skip to content

Commit bc111f1

Browse files
authored
Merge pull request #855 from rrees/rrees-apps-openess
Apps: add information about openess of source code
2 parents c6ec5a8 + bc85b73 commit bc111f1

File tree

5 files changed

+140
-17
lines changed

5 files changed

+140
-17
lines changed

components/AppCard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export type AppCardProps = {
1414
* Renders a card with app data.
1515
* Layout (width, height, positioning) can be set from the parent.
1616
*/
17-
export const AppCard = ({ name, icon, url, paid, category, categoryLabel }) => {
17+
export const AppCard = ({ name, icon, url, paid, category, categoryLabel, open }) => {
1818
return (
1919
<a
2020
key={`${url} ${name}`}
@@ -34,6 +34,7 @@ export const AppCard = ({ name, icon, url, paid, category, categoryLabel }) => {
3434
) : (
3535
<FormattedMessage id="apps.free" defaultMessage="Free" />
3636
)}
37+
{open ? <>, <FormattedMessage id="apps.open" defaultMessage="Open" /></> : null}
3738
</span>
3839
<h3 className="b1 !font-700 flex flex-auto items-center !leading-[1] rtl:text-right">
3940
<span dir="ltr">{name}</span>

components/AppsGrid.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export const AppsGrid = ({ apps }: AppsGridProps) => {
2828

2929
/** normalizing the apps dictionary as an array */
3030
const allApps = Object.entries(apps)
31-
.map(([category, apps]) =>
32-
apps.map(({ name, icon, url, paid, released_on, hidden_from_all }) => ({
31+
.flatMap(([category, apps]) =>
32+
apps.map(({ name, icon, url, paid, released_on, hidden_from_all, open }) => ({
3333
name,
3434
icon,
3535
url,
@@ -38,9 +38,9 @@ export const AppsGrid = ({ apps }: AppsGridProps) => {
3838
released_on: new Date(released_on) ?? null,
3939
category,
4040
categoryLabel: categories.find((c) => c.key === category)["label"],
41+
open,
4142
}))
4243
)
43-
.flat()
4444

4545
//prettier-ignore
4646
const sortOptions = [

0 commit comments

Comments
 (0)