Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/data/builder-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export const Tags = {

// Add your builder tool to (THE END OF) this list.
// Please don't add the "favorite"-tag yourself.
const Showcases = [
export const Showcases = [
{
title: "cardano-cli",
description: "The companion command-line to interact with a Cardano node, manipulate addresses or create transactions.",
Expand Down
4 changes: 3 additions & 1 deletion src/data/showcases.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export const Tags = {
// Add your project to (THE END OF) this list.
// Please don't add the "favorite"-tag yourself.
// Provide pure NFT projects only get the tag NFT, not "tokens"
const Showcases = [
export const Showcases = [
{
title: "Cardano Kidz",
description:
Expand Down Expand Up @@ -1063,8 +1063,10 @@ const Showcases = [
export const TagList = Object.keys(Tags);
function sortShowcases() {
let result = Showcases;

// Sort by site name
result = sortBy(result, (showcase) => showcase.title.toLowerCase());

// Sort by favorite tag, favorite first
result = sortBy(result, (showcase) => !showcase.tags.includes("favorite"));
return result;
Expand Down
9 changes: 5 additions & 4 deletions src/pages/showcase/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import ShowcaseLatestToggle, {

import PortalHero from "../portalhero";
import { toggleListItem } from "../../utils/jsUtils";
import { SortedShowcases, Tags, TagList } from "../../data/showcases";
import { SortedShowcases, Tags, TagList, Showcases } from "../../data/showcases";
import { useHistory, useLocation } from "@docusaurus/router";
import styles from "./styles.module.css";

Expand Down Expand Up @@ -70,10 +70,10 @@ function replaceSearchTags(search, newTags) {
}

// Filter projects based on chosen project tags, toggle operator or searchbar value
function filterProjects(projects, selectedTags, latest, operator, searchName) {
function filterProjects(projects, selectedTags, latest, operator, searchName, unfilteredProjects) {
// Check if "LAST" filter is applied to decide if to filter through all projects or only last ones
if (latest === "LAST") {
var projects = projects.slice(-10);
var projects = unfilteredProjects.slice(-10);
}

if (searchName) {
Expand Down Expand Up @@ -121,7 +121,8 @@ function useFilteredProjects() {
selectedTags,
latest,
operator,
searchName
searchName,
Showcases
),
[selectedTags, latest, operator, searchName]
);
Expand Down
9 changes: 5 additions & 4 deletions src/pages/tools/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import ShowcaseLatestToggle, {

import PortalHero from "../portalhero";
import { toggleListItem } from "../../utils/jsUtils";
import { SortedShowcases, Tags, TagList } from "../../data/builder-tools";
import { SortedShowcases, Tags, TagList, Showcases } from "../../data/builder-tools";
import { useHistory, useLocation } from "@docusaurus/router";
import styles from "./styles.module.css";

Expand Down Expand Up @@ -71,10 +71,10 @@ function replaceSearchTags(search, newTags) {
}

// Filter projects based on chosen project tags, toggle operator or searchbar value
function filterProjects(projects, selectedTags, latest, operator, searchName) {
function filterProjects(projects, selectedTags, latest, operator, searchName, unfilteredProjects) {
// Check if "LAST" filter is applied to decide if to filter through all projects or only last ones
if (latest === "LAST") {
var projects = projects.slice(-10);
var projects = unfilteredProjects.slice(-10);
}

if (searchName) {
Expand Down Expand Up @@ -122,7 +122,8 @@ function useFilteredProjects() {
selectedTags,
latest,
operator,
searchName
searchName,
Showcases
),
[selectedTags, latest, operator, searchName]
);
Expand Down