chore(admin): adjust import user style (#12295)

close AF-2619 AF-2618

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **Style**
  - Updated various components to use dynamic theme-based colors and consistent border radius for a more unified look and feel.
  - Adjusted icon size and text styling in the file upload area for improved visual clarity.
  - Applied consistent secondary text color to informational paragraphs.

- **User Interface**
  - Changed the table header label from "Username" to "Name" and removed uppercase styling from all table headers.
  - Updated file upload instructions for clearer guidance.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
JimmFly
2025-05-22 07:13:16 +00:00
parent 52a7698014
commit 2999497f16
4 changed files with 29 additions and 13 deletions

View File

@@ -18,7 +18,7 @@ export const CsvFormatGuidance: FC<CsvFormatGuidanceProps> = ({
}) => {
return (
<div
className="flex p-1.5 gap-1"
className="flex p-1.5 gap-1 rounded-[6px]"
style={{
fontSize: cssVar('fontXs'),
color: cssVarV2('text/secondary'),

View File

@@ -1,5 +1,6 @@
import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks';
import { UploadIcon } from '@blocksuite/icons/rc';
import { cssVarV2 } from '@toeverything/theme/v2';
import {
type ChangeEvent,
type DragEvent,
@@ -85,7 +86,7 @@ export const FileUploadArea = forwardRef<
return (
<div
className={`flex justify-center p-8 border-2 border-dashed rounded-md ${
className={`flex justify-center p-8 border-2 border-dashed rounded-[6px] ${
isDragging ? 'border-blue-500 bg-blue-50' : 'border-gray-300'
}`}
onDragOver={handleDragOver}
@@ -93,16 +94,30 @@ export const FileUploadArea = forwardRef<
onDragLeave={handleDragLeave}
onDrop={handleDrop}
onClick={triggerFileInput}
style={{
borderColor: isDragging
? cssVarV2('button/primary')
: cssVarV2('layer/insideBorder/blackBorder'),
}}
>
<div className="text-center">
<UploadIcon fontSize={36} className="mx-auto mb-2 text-gray-400" />
<div className="text-sm font-medium">
<UploadIcon
fontSize={24}
className="mx-auto mb-3"
style={{
color: cssVarV2('selfhost/icon/secondary'),
}}
/>
<div
className="text-xs font-medium"
style={{ color: cssVarV2('text/secondary') }}
>
{isDragging
? 'Release mouse to upload file'
: 'Click to upload CSV file'}
: 'Upload your CSV file or drag it here'}
</div>
<p className="mt-1 text-xs text-gray-500">
{isDragging ? 'Preparing to upload...' : 'Or drag and drop file here'}
{isDragging ? 'Preparing to upload...' : ''}
</p>
</div>
<input

View File

@@ -1,3 +1,4 @@
import { cssVarV2 } from '@toeverything/theme/v2';
import type { FC, RefObject } from 'react';
import type { ParsedUser } from '../../utils/csv-utils';
@@ -20,7 +21,7 @@ export const ImportPreviewContent: FC<ImportPreviewContentProps> = ({
return (
<div className="grid gap-3">
{!isImported && (
<p>
<p style={{ color: cssVarV2('text/secondary') }}>
{parsedUsers.length} users detected from the CSV file. Please confirm
the user list below and import.
</p>
@@ -49,7 +50,7 @@ export const ImportInitialContent: FC<ImportInitialContentProps> = ({
}) => {
return (
<div className="grid gap-3">
<p>
<p style={{ color: cssVarV2('text/secondary') }}>
You need to import the accounts by importing a CSV file in the correct
format. Please download the CSV template.
</p>

View File

@@ -13,16 +13,16 @@ export const UserTable: React.FC<UserTableProps> = ({ users }) => {
<table className="w-full border-collapse">
<thead className="bg-white sticky top-0">
<tr>
<th className="py-2 px-4 border-b text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Username
<th className="py-2 px-4 border-b text-left text-xs font-medium text-gray-500 tracking-wider ">
Name
</th>
<th className="py-2 px-4 border-b text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
<th className="py-2 px-4 border-b text-left text-xs font-medium text-gray-500 tracking-wider">
Email
</th>
<th className="py-2 px-4 border-b text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
<th className="py-2 px-4 border-b text-left text-xs font-medium text-gray-500 tracking-wider">
Password
</th>
<th className="py-2 px-4 border-b text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
<th className="py-2 px-4 border-b text-left text-xs font-medium text-gray-500 tracking-wider">
Status
</th>
</tr>