Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Oct 4, 2024
1 parent bc831b6 commit 36d2f7b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,10 @@ export function DataTable<TData, TValue>({

{hasNextPage && (
<div className="flex items-center justify-center mt-6" ref={ref}>
<Button variant="outline" className="space-x-2 px-6 py-5">
<div className="flex items-center space-x-2 px-6 py-5">
<Spinner />
<span className="text-sm text-[#606060]">Loading more...</span>
</Button>
</div>
</div>
)}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function Table({ filter, page, sort, query }: Props) {
// NOTE: When we have a filter we want to show all results so users can select
// And handle all in once (export etc)
const transactions = await getTransactions({
to: hasFilters ? maxItems : pageSize,
to: hasFilters ? maxItems : page > 0 ? pageSize : pageSize - 1,
from: 0,
filter,
sort,
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/src/components/team-dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function TeamDropdown({ selectedTeamId: initialId, teams }: Props) {
const [isOpen, onOpenChange] = useState(false);
const changeTeam = useAction(changeTeamAction);

const sortedTeams = [...teams, { team: { id: "add" } }].sort((a, b) => {
const sortedTeams = teams.sort((a, b) => {
if (a.team.id === selectedId) return -1;
if (b.team.id === selectedId) return 1;

Expand All @@ -46,7 +46,7 @@ export function TeamDropdown({ selectedTeamId: initialId, teams }: Props) {
return (
<Dialog open={isOpen} onOpenChange={onOpenChange}>
<motion.div ref={ref} layout className="w-[32px] h-[32px] relative">
{sortedTeams.map(({ team }, index) => (
{[...sortedTeams, { team: { id: "add" } }].map(({ team }, index) => (
<motion.div
key={team.id}
className="w-[32px] h-[32px] left-0 overflow-hidden absolute"
Expand Down
24 changes: 24 additions & 0 deletions apps/engine/tasks/download-gocardless.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { getFileExtension } from "@/utils/logo";
import { batchPromises, saveImageFromURL } from "./utils";

const GO_CARDLESS_CDN = "https://cdn-logos.gocardless.com/ais/";

async function main() {
const response = await fetch(
"https://bankaccountdata.gocardless.com/api/v2/institutions/",
);

const data = await response.json();

console.log(data);

const tasks = data?.map(async (institution) => {
const fileName = `${institution.id}.${getFileExtension(institution.logo)}`;

return saveImageFromURL(`${GO_CARDLESS_CDN}/${fileName}`, fileName);
});

await batchPromises(tasks);
}

main();

0 comments on commit 36d2f7b

Please sign in to comment.