Skip to content

Commit

Permalink
style(web): correct ui style for menu and project star (#1204)
Browse files Browse the repository at this point in the history
  • Loading branch information
airslice authored Oct 29, 2024
1 parent 6b7695c commit f51e1a1
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ const ProjectGridViewItem: FC<ProjectProps> = ({
<StarButtonWrapper
isStarred={isStarred ?? false}
isHovered={isHovered ?? false}
isSelected={selectedProjectId === project.id}
>
<Button
iconButton
Expand Down Expand Up @@ -130,14 +129,13 @@ const CardImage = styled("div")<{
}));

const StarButtonWrapper = styled("div")<{
isSelected: boolean;
isStarred: boolean;
isHovered: boolean;
}>(({ isSelected, isStarred, isHovered }) => ({
}>(({ isStarred, isHovered }) => ({
position: "absolute",
top: "10px",
right: "10px",
opacity: isSelected || isStarred || isHovered ? 1 : 0
opacity: isStarred || isHovered ? 1 : 0
}));

const CardFooter = styled("div")(({ theme }) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ const ProjectListViewItem: FC<ProjectProps> = ({
<StarButtonWrapper
isStarred={isStarred ?? false}
isHovered={isHovered ?? false}
isSelected={selectedProjectId === project.id}
>
<Button
iconButton
Expand Down Expand Up @@ -197,11 +196,10 @@ const ActionCol = styled("div")(() => ({
}));

const StarButtonWrapper = styled("div")<{
isSelected: boolean;
isStarred: boolean;
isHovered: boolean;
}>(({ isSelected, isStarred, isHovered }) => ({
opacity: isSelected || isStarred || isHovered ? 1 : 0
}>(({ isStarred, isHovered }) => ({
opacity: isStarred || isHovered ? 1 : 0
}));

const TitleWrapper = styled("div")(({ theme }) => ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { LayerAppearanceTypes } from "@reearth/core";
import { LayerStyle } from "@reearth/services/api/layerStyleApi/utils";

export const defaultStyle: Partial <LayerAppearanceTypes> = {
export const defaultStyle: Partial<LayerAppearanceTypes> = {
marker: {
heightReference: "clamp"
},
Expand Down
10 changes: 9 additions & 1 deletion web/src/beta/features/ProjectSettings/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,15 @@ export default ({ projectId }: Props) => {
if (status === "success") {
navigate(`/dashboard/${workspaceId}/`);
}
}, [client.cache, disabled, handleProjectPublish, navigate, projectId, useUpdateProjectRemove, workspaceId]);
}, [
client.cache,
disabled,
handleProjectPublish,
navigate,
projectId,
useUpdateProjectRemove,
workspaceId
]);

const handleUpdateProjectBasicAuth = useCallback(
async (settings: PublicBasicAuthSettingsType) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ export default ({
[engineRef]
);


const selectLayer = useCallback(
(layerId: string | undefined) => {
layersRef?.select(layerId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export type Context = {
findPhotooverlayLayer?: (
id: string
) => { title?: string; lat: number; lng: number; height: number } | undefined;
getCredits?: () => Credit[] | undefined
getCredits?: () => Credit[] | undefined;
};

export type ComponentProps<P = any> = Omit<Props, "widget" | "renderWidget"> & {
Expand Down
2 changes: 1 addition & 1 deletion web/src/beta/features/Visualizer/Crust/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export default function Crust({
viewerProperty,
initialCamera,
selectedLayerId,
timelineManagerRef: mapRef?.current?.timeline,
timelineManagerRef: mapRef?.current?.timeline
});

const featuredInfobox = useMemo(() => {
Expand Down
3 changes: 2 additions & 1 deletion web/src/beta/lib/reearth-ui/components/PopupMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ const StyledLink = styled(Link)(() => ({

const IconWrapper = styled("div")(() => ({
flexGrow: 0,
flexShrink: 0
flexShrink: 0,
fontSize: 0
}));
const SubMenuHeader = styled("div")(({ theme }) => ({
color: theme.content.weak,
Expand Down

0 comments on commit f51e1a1

Please sign in to comment.