Skip to content

Commit

Permalink
chore: hide missing feat within alpha, adjust the i18n mobile menu, a…
Browse files Browse the repository at this point in the history
…djust the param for numeric input #1984 #1983
  • Loading branch information
arealclimber committed Aug 9, 2024
1 parent eb6faa6 commit 3bb27bc
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iSunFA",
"version": "0.1.8+166",
"version": "0.1.8+167",
"private": false,
"scripts": {
"dev": "next dev",
Expand Down
8 changes: 4 additions & 4 deletions src/components/i18n/i18n.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,18 @@ const I18n = ({ langIsOpen, setLangIsOpen }: II18nProps) => {
<div
className={`transition-all duration-300 ${
openMenu
? 'visible -translate-y-19rem opacity-100'
? 'visible -translate-y-7rem opacity-100'
: 'invisible -translate-y-36rem opacity-0'
} lg:hidden`}
>
<div
id="I18nMenuMobile"
className="absolute left-0 top-0 z-10 h-350px w-screen bg-white shadow"
className="absolute left-0 top-0 z-10 h-300px w-screen bg-white shadow"
>
<button
onClick={mobileClickHandler}
type="button"
className="p-16px text-button-text-secondary hover:text-button-text-primary"
className="px-4 pt-2 text-button-text-secondary hover:text-button-text-primary"
>
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down Expand Up @@ -107,7 +107,7 @@ const I18n = ({ langIsOpen, setLangIsOpen }: II18nProps) => {
scroll={false}
locale={item.value}
href={asPath}
className="block rounded-none px-3 py-7 font-medium hover:cursor-pointer"
className="block rounded-none px-3 py-7 font-medium text-button-text-secondary hover:cursor-pointer hover:text-button-text-primary"
>
{item.label}
</Link>
Expand Down
10 changes: 6 additions & 4 deletions src/components/nav_bar/nav_bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,15 @@ const NavBar = () => {
</button>
<div className="mt-3 flex justify-center gap-0 px-16">
<div className="my-auto text-base font-semibold leading-6 tracking-normal text-button-text-secondary">
{signedIn ? username ?? DEFAULT_DISPLAYED_USER_NAME : ''}
{signedIn ? (username ?? DEFAULT_DISPLAYED_USER_NAME) : ''}
</div>
{/* Info: edit name button (20240809 - Shirley) */}
<button
type="button"
// TODO: temp disabled (20240517 - Shirley)
// eslint-disable-next-line react/jsx-boolean-value
disabled={true}
className="flex shrink-0 flex-col justify-center rounded-xs px-2 disabled:text-button-text-disable"
className="hidden shrink-0 flex-col justify-center rounded-xs px-2 text-button-surface-strong-secondary disabled:text-button-text-disable"
>
<div className="flex items-center justify-center">
<svg
Expand All @@ -346,7 +347,7 @@ const NavBar = () => {
viewBox="0 0 17 16"
>
<path
fill="#001840"
className="fill-current"
fillRule="evenodd"
d="M12.128.96a2.414 2.414 0 113.415 3.415L9.167 10.75l-.045.045c-.184.185-.38.382-.62.529a2.335 2.335 0 01-.674.28c-.273.065-.552.064-.812.064H5.835a1 1 0 01-1-1V9.55v-.064c0-.26 0-.539.065-.812.057-.238.151-.465.28-.674.146-.24.343-.436.528-.62l.045-.045L12.128.96zm2 1.415a.414.414 0 00-.585 0L7.167 8.75c-.121.121-.189.19-.238.243m7.2-6.618a.414.414 0 010 .586v-.586zm-9.132-.707h2.839a1 1 0 110 2h-2.8c-.577 0-.95 0-1.233.024-.271.022-.372.06-.421.085a1 1 0 00-.437.437c-.026.05-.063.15-.086.422-.023.283-.023.655-.023 1.232v5.6c0 .576 0 .949.023 1.232.023.272.06.372.086.422a1 1 0 00.437.437c.049.025.15.063.421.085.284.023.656.024 1.233.024h5.6c.576 0 .948-.001 1.232-.024.271-.022.372-.06.421-.085a1 1 0 00.438-.437c.025-.05.062-.15.085-.422.023-.283.024-.656.024-1.232v-2.8a1 1 0 112 0V11.506c0 .527 0 .982-.031 1.357-.032.395-.104.788-.296 1.167a3 3 0 01-1.312 1.31c-.378.194-.771.265-1.166.297-.375.03-.83.03-1.357.03H4.997c-.527 0-.982 0-1.357-.03-.395-.032-.788-.103-1.166-.296a3 3 0 01-1.312-1.311c-.192-.379-.264-.772-.296-1.167-.03-.375-.03-.83-.03-1.357V5.83c0-.527 0-.982.03-1.356.032-.396.104-.789.296-1.167a3 3 0 011.312-1.311c.378-.193.771-.264 1.166-.297.375-.03.83-.03 1.357-.03zm9.131 1.293L7.753 9.336l6.375-6.375zM6.884 9.047v-.001.001zm0-.001a.334.334 0 00-.04.096.61.61 0 00-.005.069 8.42 8.42 0 00-.004.34v.117h.117c.172 0 .268 0 .34-.004.064-.003.075-.007.069-.005a.333.333 0 00.095-.04m.297-.283a8.41 8.41 0 01-.243.238l.243-.238zm-.243.238a.61.61 0 01-.053.045l.053-.045z"
clipRule="evenodd"
Expand Down Expand Up @@ -390,7 +391,8 @@ const NavBar = () => {
<Button
variant={'secondaryBorderless'}
disabled={!selectedCompany} // Info: (20240513 - Julian) 如果沒有選擇 company 就不能使用
className="mt-3 flex w-full justify-start rounded-xs px-4 py-2.5 disabled:text-button-text-disable"
// Info: disabled for now (20240809 - Shirley)
className="mt-3 hidden w-full justify-start rounded-xs px-4 py-2.5 disabled:text-button-text-disable"
>
<div className="my-auto flex items-center justify-center">
<svg
Expand Down
4 changes: 2 additions & 2 deletions src/components/new_journal_form/new_journal_form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ const NewJournalForm = () => {
isDecimal
required
hasComma
onChange={amountChangeHandler}
triggerWhenChanged={amountChangeHandler}
className="h-46px flex-1 rounded-l-sm border border-lightGray3 bg-white p-10px outline-none"
/>
<div className="flex items-center gap-4px rounded-r-sm border border-l-0 border-lightGray3 bg-white p-12px text-sm text-lightGray4">
Expand Down Expand Up @@ -953,7 +953,7 @@ const NewJournalForm = () => {
isDecimal
required={feeToggle}
hasComma
onChange={amountChangeHandler}
triggerWhenChanged={amountChangeHandler}
className="h-46px flex-1 rounded-l-sm border border-lightGray3 bg-transparent p-10px outline-none md:w-1/2"
/>
<div className="flex items-center gap-4px rounded-r-sm border border-l-0 border-lightGray3 p-12px text-sm text-lightGray4">
Expand Down
6 changes: 3 additions & 3 deletions src/components/numeric_input/numeric_input.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { useState, useEffect } from 'react';
import { numberWithCommas } from '@/lib/utils/common';

interface INumericInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
interface INumericInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
value: number;
setValue: React.Dispatch<React.SetStateAction<number>>;
isDecimal?: boolean;
hasComma?: boolean; // Info: (20240722 - Liz) 新增逗號顯示
onChange?: (value: number, e: React.ChangeEvent<HTMLInputElement>) => void;
triggerWhenChanged?: (value: number, e: React.ChangeEvent<HTMLInputElement>) => void;
}

const formatDisplayValue = (
Expand All @@ -29,7 +29,7 @@ const NumericInput = ({
setValue,
isDecimal,
hasComma,
onChange: triggerWhenChanged,
triggerWhenChanged,
...props
}: INumericInputProps) => {
// Info: (20240723 - Liz) displayValue 是顯示在 input 上的顯示值
Expand Down
2 changes: 1 addition & 1 deletion src/components/progress_bar/progress_bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const ProgressBar = ({ progressRate, setProgressRate }: IProgressBarProps) => {
name="input-progress-rate"
value={progressRate}
setValue={setProgressRate}
// onChange={progressRateChangeHandler} // TODO: 原先 NumericInput 不接受外部的 onChange 事件,目前看不出來 ProgressBar 沒有 onChange 之後會有什麼問題 (20240809 - Shirley)
onChange={progressRateChangeHandler}
min={0}
max={100}
className="flex-1 bg-transparent px-10px outline-none"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ const SelectCompanyPageBody = () => {
<button
type="button"
onClick={companyInvitationModalVisibilityHandler}
className="flex w-full items-center justify-start gap-3 border-t px-12px py-8px text-xs text-lightGray5"
// Info: disabled for now (20240809 - Shirley)
className="hidden w-full items-center justify-start gap-3 border-t px-12px py-8px text-xs text-lightGray5"
>
<Image src="/icons/invitation.svg" width={16} height={16} alt="invitation_icon" />
<p>{t('SELECT_COMPANY.ENTER_INVITATION_CODE')}</p>
Expand Down
12 changes: 9 additions & 3 deletions src/components/step_one_tab/step_one_tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { IOCR } from '@/interfaces/ocr';
import { ToastType } from '@/interfaces/toastify';
import { ProgressStatus } from '@/constants/account';
import UploadedFileItem from '@/components/uploaded_file_item/uploaded_file_item';
import Pagination from '@/components/pagination/pagination';
// Info: (20240809 - Shirley) disabled for now , 分頁功能在 alpha release 還沒實作
// import Pagination from '@/components/pagination/pagination';
import JournalUploadArea from '@/components/journal_upload_area/journal_upload_area';
import Link from 'next/link';
import { ISUNFA_ROUTE } from '@/constants/url';
Expand All @@ -33,8 +34,12 @@ const StepOneTab = () => {
const { cameraScannerVisibilityHandler, toastHandler } = useGlobalCtx();
const { selectedCompany } = useUserCtx();
const { OCRList, OCRListStatus, updateOCRListHandler, selectOCRHandler } = useAccountingCtx();
// Info: (20240809 - Shirley) disabled for now , 分頁功能在 alpha release 還沒實作
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [currentFilePage, setCurrentFilePage] = useState<number>(1);
const [fileList, setFileList] = useState<IOCR[]>(OCRList);
// Info: (20240809 - Shirley) disabled for now , 分頁功能在 alpha release 還沒實作
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [totalPages, setTotalPages] = useState<number>(1);
const { trigger: deleteOCRTrigger } = APIHandler<void>(APIName.OCR_DELETE);

Expand Down Expand Up @@ -168,14 +173,15 @@ const StepOneTab = () => {
<div className="mb-50px flex flex-col items-center gap-y-50px">
<div className="flex w-full flex-col items-center gap-y-12px">{displayedFileList}</div>
{/* Info: (20240523 - Julian) Pagination */}
{totalPages > 1 && (
{/* Info: (20240809 - Shirley) disabled for now , 分頁功能在 alpha release 還沒實作 */}
{/* {totalPages > 1 && (
<Pagination
currentPage={currentFilePage}
totalPages={totalPages}
setCurrentPage={setCurrentFilePage}
pagePrefix="filePage"
/>
)}
)} */}
</div>
</>
) : null;
Expand Down

0 comments on commit 3bb27bc

Please sign in to comment.