chore: updates
This commit is contained in:
@@ -23,7 +23,7 @@ const PinnedMessageView: FC<Props> = ({ data }) => {
|
||||
|
||||
const { content_type, content, properties, thumbnail = "" } = { ...data, ...normalized };
|
||||
const uid = msgData[mid]?.from_uid || 0;
|
||||
const created_at = msgData[mid]?.created_at || 0;
|
||||
const created_at = data.created_at ? data.created_at : msgData[mid]?.created_at;
|
||||
const { name, avatar } = usersData[uid] ?? {};
|
||||
return (
|
||||
<div className="w-full relative flex items-start gap-3 p-2 my-2 rounded-lg">
|
||||
@@ -33,9 +33,11 @@ const PinnedMessageView: FC<Props> = ({ data }) => {
|
||||
<div className="w-full flex flex-col items-start gap-1 text-sm">
|
||||
<div className="flex items-center gap-2 font-semibold">
|
||||
<span className="text-gray-500">{name}</span>
|
||||
<time className="text-xs text-gray-400">
|
||||
{dayjs(created_at).format("YYYY-MM-DD h:mm:ss A")}
|
||||
</time>
|
||||
{created_at && (
|
||||
<time className="text-xs text-gray-400">
|
||||
{dayjs(created_at).format("YYYY-MM-DD h:mm:ss A")}
|
||||
</time>
|
||||
)}
|
||||
</div>
|
||||
<div className={`select-text text-gray-600 break-all whitespace-pre-wrap dark:text-white`}>
|
||||
{renderContent({
|
||||
|
||||
@@ -2,6 +2,10 @@ import dayjs from "dayjs";
|
||||
|
||||
import "dayjs/locale/zh-cn";
|
||||
import "dayjs/locale/ja";
|
||||
import "dayjs/locale/fr";
|
||||
import "dayjs/locale/pt";
|
||||
import "dayjs/locale/tr";
|
||||
import "dayjs/locale/es";
|
||||
import duration from "dayjs/plugin/duration";
|
||||
import isToday from "dayjs/plugin/isToday";
|
||||
import isYesterday from "dayjs/plugin/isYesterday";
|
||||
|
||||
@@ -5,8 +5,16 @@ import SettingBlock from "@/components/SettingBlock";
|
||||
import StyledRadio from "@/components/styled/Radio";
|
||||
|
||||
// type Props = {}
|
||||
type LanguageType = "en" | "zh" | "jp" | "tr" | "pt" | "es";
|
||||
const Langs: LanguageType[] = ["en", "zh", "jp", "tr", "pt", "es"];
|
||||
type LanguageType = "en" | "zh" | "jp" | "tr" | "pt" | "es" | "fr";
|
||||
const LangMap: Record<LanguageType, string> = {
|
||||
en: "English",
|
||||
zh: "中文",
|
||||
tr: "Türkçe",
|
||||
jp: "日本語",
|
||||
pt: "Portuguese",
|
||||
fr: "Français",
|
||||
es: "Español"
|
||||
};
|
||||
const Index = () => {
|
||||
const { t, i18n } = useTranslation("setting");
|
||||
const handleGuestToggle = (v: LanguageType) => {
|
||||
@@ -15,15 +23,8 @@ const Index = () => {
|
||||
return (
|
||||
<SettingBlock title={t("overview.lang.title")} desc={t("overview.lang.desc")}>
|
||||
<StyledRadio
|
||||
options={[
|
||||
t("overview.lang.en"),
|
||||
t("overview.lang.zh"),
|
||||
t("overview.lang.jp"),
|
||||
t("overview.lang.tr"),
|
||||
t("overview.lang.pt"),
|
||||
t("overview.lang.es")
|
||||
]}
|
||||
values={Langs}
|
||||
options={Object.values(LangMap)}
|
||||
values={Object.keys(LangMap)}
|
||||
value={i18n.language.split("-")[0]}
|
||||
onChange={(v) => {
|
||||
const _v = v as LanguageType;
|
||||
|
||||
@@ -5,8 +5,16 @@ import SettingBlock from "@/components/SettingBlock";
|
||||
import StyledRadio from "@/components/styled/Radio";
|
||||
|
||||
// type Props = {}
|
||||
type LanguageType = "en" | "zh" | "jp" | "tr" | "pt" | "es";
|
||||
const Langs: LanguageType[] = ["en", "zh", "jp", "tr", "pt", "es"];
|
||||
type LanguageType = "en" | "zh" | "jp" | "tr" | "pt" | "es" | "fr";
|
||||
const LangMap: Record<LanguageType, string> = {
|
||||
en: "English",
|
||||
zh: "中文",
|
||||
tr: "Türkçe",
|
||||
jp: "日本語",
|
||||
pt: "Portuguese",
|
||||
fr: "Français",
|
||||
es: "Español"
|
||||
};
|
||||
const Index = () => {
|
||||
const { t, i18n } = useTranslation("setting");
|
||||
const handleGuestToggle = (v: LanguageType) => {
|
||||
@@ -15,15 +23,8 @@ const Index = () => {
|
||||
return (
|
||||
<SettingBlock title={t("overview.lang.title")} desc={t("overview.lang.desc")}>
|
||||
<StyledRadio
|
||||
options={[
|
||||
t("overview.lang.en"),
|
||||
t("overview.lang.zh"),
|
||||
t("overview.lang.jp"),
|
||||
t("overview.lang.tr"),
|
||||
t("overview.lang.pt"),
|
||||
t("overview.lang.es")
|
||||
]}
|
||||
values={Langs}
|
||||
options={Object.values(LangMap)}
|
||||
values={Object.keys(LangMap)}
|
||||
value={i18n.language.split("-")[0]}
|
||||
onChange={(v) => {
|
||||
const _v = v as LanguageType;
|
||||
|
||||
Reference in New Issue
Block a user