[WEB-5459] feat(codemods): add function declaration transformer with tests (#8137)
- Add jscodeshift-based codemod to convert arrow function components to function declarations - Support React.FC, observer-wrapped, and forwardRef components - Include comprehensive test suite covering edge cases - Add npm script to run transformer across codebase - Target only .tsx files in source directories, excluding node_modules and declaration files * [WEB-5459] chore: updates after running codemod --------- Co-authored-by: sriramveeraghanta <veeraghanta.sriram@gmail.com>
This commit is contained in:
parent
90866fb925
commit
83fdebf64d
1771 changed files with 17003 additions and 13856 deletions
|
|
@ -8,7 +8,7 @@ import { useAppRouter } from "@/hooks/use-app-router";
|
|||
// plane web helpers
|
||||
import { shouldRenderSettingLink } from "@/plane-web/helpers/workspace.helper";
|
||||
|
||||
export const MobileWorkspaceSettingsTabs = observer(() => {
|
||||
export const MobileWorkspaceSettingsTabs = observer(function MobileWorkspaceSettingsTabs() {
|
||||
const router = useAppRouter();
|
||||
const { workspaceSlug } = useParams();
|
||||
const pathname = usePathname();
|
||||
|
|
|
|||
|
|
@ -27,26 +27,18 @@ export const WORKSPACE_SETTINGS_ICONS: Record<keyof typeof WORKSPACE_SETTINGS, L
|
|||
webhooks: Webhook,
|
||||
};
|
||||
|
||||
export const WorkspaceActionIcons = ({
|
||||
type,
|
||||
size,
|
||||
className,
|
||||
}: {
|
||||
type: string;
|
||||
size?: number;
|
||||
className?: string;
|
||||
}) => {
|
||||
export function WorkspaceActionIcons({ type, size, className }: { type: string; size?: number; className?: string }) {
|
||||
if (type === undefined) return null;
|
||||
const Icon = WORKSPACE_SETTINGS_ICONS[type as keyof typeof WORKSPACE_SETTINGS_ICONS];
|
||||
if (!Icon) return null;
|
||||
return <Icon size={size} className={className} strokeWidth={2} />;
|
||||
};
|
||||
}
|
||||
|
||||
type TWorkspaceSettingsSidebarProps = {
|
||||
isMobile?: boolean;
|
||||
};
|
||||
|
||||
export const WorkspaceSettingsSidebar = (props: TWorkspaceSettingsSidebarProps) => {
|
||||
export function WorkspaceSettingsSidebar(props: TWorkspaceSettingsSidebarProps) {
|
||||
const { isMobile = false } = props;
|
||||
// router
|
||||
const pathname = usePathname();
|
||||
|
|
@ -77,4 +69,4 @@ export const WorkspaceSettingsSidebar = (props: TWorkspaceSettingsSidebarProps)
|
|||
actionIcons={WorkspaceActionIcons}
|
||||
/>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,18 +19,18 @@ const ICONS = {
|
|||
connections: Blocks,
|
||||
};
|
||||
|
||||
export const ProjectActionIcons = ({ type, size, className }: { type: string; size?: number; className?: string }) => {
|
||||
export function ProjectActionIcons({ type, size, className }: { type: string; size?: number; className?: string }) {
|
||||
if (type === undefined) return null;
|
||||
const Icon = ICONS[type as keyof typeof ICONS];
|
||||
if (!Icon) return null;
|
||||
return <Icon size={size} className={className} strokeWidth={2} />;
|
||||
};
|
||||
}
|
||||
|
||||
type TProfileSidebarProps = {
|
||||
isMobile?: boolean;
|
||||
};
|
||||
|
||||
export const ProfileSidebar = observer((props: TProfileSidebarProps) => {
|
||||
export const ProfileSidebar = observer(function ProfileSidebar(props: TProfileSidebarProps) {
|
||||
const { isMobile = false } = props;
|
||||
// router
|
||||
const pathname = usePathname();
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { Button, getButtonStyling } from "@plane/propel/button";
|
|||
import { cn } from "@plane/utils";
|
||||
import { useCommandPalette } from "@/hooks/store/use-command-palette";
|
||||
|
||||
const ProjectSettingsPage = () => {
|
||||
function ProjectSettingsPage() {
|
||||
// store hooks
|
||||
const { resolvedTheme } = useTheme();
|
||||
const { toggleCreateProjectModal } = useCommandPalette();
|
||||
|
|
@ -37,6 +37,6 @@ const ProjectSettingsPage = () => {
|
|||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
export default ProjectSettingsPage;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue