Skip to content

Commit

Permalink
refactor: rename the image component
Browse files Browse the repository at this point in the history
  • Loading branch information
malkiii committed Apr 14, 2024
1 parent 8c027d9 commit 4bd9d6a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions apps/demo/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import ImageInput from '~/components/image-input';
import AvatarInput from '~/components/avatar-input';
import { site } from '~/data/constants';

export default function Page() {
Expand All @@ -14,7 +14,7 @@ export default function Page() {
padding: '0 1rem',
}}
>
<ImageInput />
<AvatarInput />
<GithubCorner />
</main>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { useScrollPosition, useSwiping } from 'react-pre-hooks';

// input component
export default function ImageInput() {
export default function AvatarInput() {
const [imageFile, setImageFile] = React.useState<File>();
const [croppedImage, setCroppedImage] = React.useState<string>();

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import transformTypescript from '@babel/plugin-transform-typescript';
import babel from '@babel/core';

const rootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../');
export const componentPath = 'apps/demo/components/image-input.tsx';
export const componentPath = 'apps/demo/components/avatar-input.tsx';

export function getPackageInfo() {
const pkg = JSON.parse(fs.readFileSync(path.join(rootDir, 'package.json'), 'utf-8'));
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function main() {

const project = getProjectInfo(dir, options.path);

const componentName = `ImageInput.${project.isTsProject ? 'tsx' : 'jsx'}`;
const componentName = `avatar-input.${project.isTsProject ? 'tsx' : 'jsx'}`;
const componentContent = await getComponentFileContent(pkg.repository, project.isTsProject);
const contentPrefix = project.isUsingRSC ? "'use client';\n\n" : '';

Expand Down

0 comments on commit 4bd9d6a

Please sign in to comment.