Skip to content

Commit

Permalink
fix: pwa splash & remove preview img from build
Browse files Browse the repository at this point in the history
  • Loading branch information
irfancoder committed Jan 16, 2023
1 parent 3f6a96f commit 85540fc
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/Section/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Section: FunctionComponent<SectionProps> = forwardRef(
<section className={className} ref={ref}>
<div className="pb-2 lg:pb-4">
<div className="flex flex-col items-start gap-2 pb-4 lg:flex-row lg:items-center lg:justify-between">
<h4>{title}</h4>
{title && typeof title === "string" ? <h4>{title}</h4> : title}
{date && date !== null && (
<span className="text-right text-sm text-dim">
{t("common.data_of", { date: displayDate })}
Expand Down
15 changes: 12 additions & 3 deletions data-catalogue/show.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { CATALOGUE_TABLE_SCHEMA, UNIVERSAL_TABLE_SCHEMA } from "@lib/schema/data
import { OptionType } from "@components/types";
import { track } from "@lib/mixpanel";
import dynamic from "next/dynamic";
import Image from "next/image";
import Card from "@components/Card";
import At from "@components/At";
import CodeBlock from "@components/CodeBlock";
Expand Down Expand Up @@ -418,7 +419,7 @@ const CatalogueShow: FunctionComponent<CatalogueShowProps> = ({
))}
</ul>
</div>
{/* Licensd */}
{/* License */}
<div className="space-y-3">
<h5>{t("catalogue.meta_license")}</h5>
<p className="text-dim">
Expand Down Expand Up @@ -487,7 +488,7 @@ const CatalogueShow: FunctionComponent<CatalogueShowProps> = ({
<Section
title={t("catalogue.code")}
description={t("catalogue.code_desc")}
className="mx-auto w-full border-b py-12 "
className="mx-auto w-full border-b py-12"
>
<CodeBlock url={urls.parquet} />
</Section>
Expand Down Expand Up @@ -515,11 +516,18 @@ const DownloadCard: FunctionComponent<DownloadCard> = ({
meta,
}) => {
return typeof href === "string" ? (
// .csv & .parquet
<a href={href} download onClick={() => track("file_download", meta)}>
<Card className="rounded-md border border-outline bg-background px-4.5 py-5">
<div className="flex items-center gap-4.5">
{image && (
<img src={image} className="h-16 w-auto object-contain" alt={title as string} />
<Image
height={54}
width={54}
src={image}
className="object-contain"
alt={title as string}
/>
)}
<div className="block flex-grow">
<p className="font-bold">{title}</p>
Expand All @@ -531,6 +539,7 @@ const DownloadCard: FunctionComponent<DownloadCard> = ({
</Card>
</a>
) : (
// .png & svg
<Card className="rounded-md border border-outline bg-background px-4.5 py-5" onClick={href}>
<div className="flex items-center gap-4.5">
{image && (
Expand Down
2 changes: 1 addition & 1 deletion hooks/useTranslation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const useTranslation = (namespace: string = "common") => {
let translation = t(key, params);
let matches = translation.split(delimiter);

if (!matches.length) return translation;
if (matches.length <= 1) return translation;

return matches.map(item => {
const match = item.match(regex);
Expand Down
5 changes: 4 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/** @type {import('next').NextConfig} */
const withPlugins = require("next-compose-plugins");
const { i18n } = require("./next-i18next.config");
const withPWA = require("next-pwa")({ dest: "public" });
const withPWA = require("next-pwa")({
dest: "public",
buildExcludes: ["./public/static/images/opendosm-github.png"],
});

module.exports = withPlugins(
[
Expand Down
Binary file modified public/static/images/icons/apple_splash_1125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/static/images/icons/apple_splash_1242.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/static/images/icons/apple_splash_1536.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/static/images/icons/apple_splash_1668.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/static/images/icons/apple_splash_2048.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/static/images/icons/apple_splash_640.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/static/images/icons/apple_splash_750.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 85540fc

Please sign in to comment.