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:
@@ -18,7 +18,7 @@ export const CsvFormatGuidance: FC<CsvFormatGuidanceProps> = ({
|
|||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="flex p-1.5 gap-1"
|
className="flex p-1.5 gap-1 rounded-[6px]"
|
||||||
style={{
|
style={{
|
||||||
fontSize: cssVar('fontXs'),
|
fontSize: cssVar('fontXs'),
|
||||||
color: cssVarV2('text/secondary'),
|
color: cssVarV2('text/secondary'),
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks';
|
import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks';
|
||||||
import { UploadIcon } from '@blocksuite/icons/rc';
|
import { UploadIcon } from '@blocksuite/icons/rc';
|
||||||
|
import { cssVarV2 } from '@toeverything/theme/v2';
|
||||||
import {
|
import {
|
||||||
type ChangeEvent,
|
type ChangeEvent,
|
||||||
type DragEvent,
|
type DragEvent,
|
||||||
@@ -85,7 +86,7 @@ export const FileUploadArea = forwardRef<
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<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'
|
isDragging ? 'border-blue-500 bg-blue-50' : 'border-gray-300'
|
||||||
}`}
|
}`}
|
||||||
onDragOver={handleDragOver}
|
onDragOver={handleDragOver}
|
||||||
@@ -93,16 +94,30 @@ export const FileUploadArea = forwardRef<
|
|||||||
onDragLeave={handleDragLeave}
|
onDragLeave={handleDragLeave}
|
||||||
onDrop={handleDrop}
|
onDrop={handleDrop}
|
||||||
onClick={triggerFileInput}
|
onClick={triggerFileInput}
|
||||||
|
style={{
|
||||||
|
borderColor: isDragging
|
||||||
|
? cssVarV2('button/primary')
|
||||||
|
: cssVarV2('layer/insideBorder/blackBorder'),
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<UploadIcon fontSize={36} className="mx-auto mb-2 text-gray-400" />
|
<UploadIcon
|
||||||
<div className="text-sm font-medium">
|
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
|
{isDragging
|
||||||
? 'Release mouse to upload file'
|
? 'Release mouse to upload file'
|
||||||
: 'Click to upload CSV file'}
|
: 'Upload your CSV file or drag it here'}
|
||||||
</div>
|
</div>
|
||||||
<p className="mt-1 text-xs text-gray-500">
|
<p className="mt-1 text-xs text-gray-500">
|
||||||
{isDragging ? 'Preparing to upload...' : 'Or drag and drop file here'}
|
{isDragging ? 'Preparing to upload...' : ''}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<input
|
<input
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { cssVarV2 } from '@toeverything/theme/v2';
|
||||||
import type { FC, RefObject } from 'react';
|
import type { FC, RefObject } from 'react';
|
||||||
|
|
||||||
import type { ParsedUser } from '../../utils/csv-utils';
|
import type { ParsedUser } from '../../utils/csv-utils';
|
||||||
@@ -20,7 +21,7 @@ export const ImportPreviewContent: FC<ImportPreviewContentProps> = ({
|
|||||||
return (
|
return (
|
||||||
<div className="grid gap-3">
|
<div className="grid gap-3">
|
||||||
{!isImported && (
|
{!isImported && (
|
||||||
<p>
|
<p style={{ color: cssVarV2('text/secondary') }}>
|
||||||
{parsedUsers.length} users detected from the CSV file. Please confirm
|
{parsedUsers.length} users detected from the CSV file. Please confirm
|
||||||
the user list below and import.
|
the user list below and import.
|
||||||
</p>
|
</p>
|
||||||
@@ -49,7 +50,7 @@ export const ImportInitialContent: FC<ImportInitialContentProps> = ({
|
|||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<div className="grid gap-3">
|
<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
|
You need to import the accounts by importing a CSV file in the correct
|
||||||
format. Please download the CSV template.
|
format. Please download the CSV template.
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -13,16 +13,16 @@ export const UserTable: React.FC<UserTableProps> = ({ users }) => {
|
|||||||
<table className="w-full border-collapse">
|
<table className="w-full border-collapse">
|
||||||
<thead className="bg-white sticky top-0">
|
<thead className="bg-white sticky top-0">
|
||||||
<tr>
|
<tr>
|
||||||
<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 ">
|
||||||
Username
|
Name
|
||||||
</th>
|
</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
|
Email
|
||||||
</th>
|
</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
|
Password
|
||||||
</th>
|
</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
|
Status
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user