diff --git a/backend/api/search/serializers.py b/backend/api/search/serializers.py index 3deb4e7..b1a5b01 100644 --- a/backend/api/search/serializers.py +++ b/backend/api/search/serializers.py @@ -21,7 +21,7 @@ class SearchRouteSerializer(RouteSerializer): formatted_arrival = serializers.DateTimeField(source='arrival_DT') country_from_icon = serializers.SerializerMethodField() country_to_icon = serializers.SerializerMethodField() - + is_highlighted = serializers.BooleanField() class Meta: model = Route fields = ( @@ -30,7 +30,7 @@ class SearchRouteSerializer(RouteSerializer): 'to_city_name', 'to_city_russian_name', 'to_country_name', 'formatted_cargo_type', 'formatted_transport', 'type_transport', 'userImg', 'comment', 'formatted_departure', 'formatted_arrival', - 'country_from_icon', 'country_to_icon' + 'country_from_icon', 'country_to_icon', 'is_highlighted' ) def get_username(self, obj): diff --git a/frontend/app/(urls)/account/routes/page.tsx b/frontend/app/(urls)/account/routes/page.tsx index b226fb9..c3471e7 100644 --- a/frontend/app/(urls)/account/routes/page.tsx +++ b/frontend/app/(urls)/account/routes/page.tsx @@ -119,7 +119,7 @@ export default function UserRoutes() { const getBorderColor = (route: Route) => { if (route.is_highlighted) { - return 'border-yellow-500' + return 'border-yellow-500 border-2' } return 'border' } @@ -142,7 +142,7 @@ export default function UserRoutes() { {routes.map(route => (
ID маршрута: #{route.id}
diff --git a/frontend/app/(urls)/search/components/SearchCard.tsx b/frontend/app/(urls)/search/components/SearchCard.tsx index bdac3f2..f990455 100644 --- a/frontend/app/(urls)/search/components/SearchCard.tsx +++ b/frontend/app/(urls)/search/components/SearchCard.tsx @@ -45,6 +45,7 @@ const SearchCard = ({ formatted_arrival, country_from_icon, country_to_icon, + is_highlighted, }: SearchCardProps) => { const [isLeadPopupOpen, setIsLeadPopupOpen] = useState(false) const { isAuthenticated } = useUserStore() @@ -74,11 +75,18 @@ const SearchCard = ({ const userRequest = owner_type === 'customer' ? 'Нужен перевозчик' : 'Могу перевезти' + const getBorderColor = () => { + if (is_highlighted) { + return 'border-yellow-500 border-3' + } + return null + } + return ( <> {/* десктоп */}
-
+
@@ -220,7 +228,7 @@ const SearchCard = ({ {/* мобилка */}
-
+
{userRequest}
diff --git a/frontend/app/types/index.ts b/frontend/app/types/index.ts index 10e0018..0ffcce5 100644 --- a/frontend/app/types/index.ts +++ b/frontend/app/types/index.ts @@ -47,6 +47,7 @@ export interface SearchCardProps { formatted_arrival: string country_from_icon: string country_to_icon: string + is_highlighted?: boolean } export interface AccordionProps {