change(ui): city, state display
This commit is contained in:
parent
9ba3a7e7f6
commit
770d8ee7e4
3 changed files with 2 additions and 12 deletions
|
|
@ -128,7 +128,7 @@ def create_feature_flag(project_id: int, user_id: int, feature_flag_data: schema
|
|||
if row is None:
|
||||
return None
|
||||
|
||||
return get_feature_flag(project_id=project_id, feature_flag_id=row["feature_flag_id"])
|
||||
return get_feature_flag(project_id =project_id, feature_flag_id=row["feature_flag_id"])
|
||||
|
||||
|
||||
def get_feature_flag(project_id: int, feature_flag_id: int) -> Optional[Dict[str, Any]]:
|
||||
|
|
|
|||
|
|
@ -74,9 +74,6 @@ function UserCard({ className, request, session, width, height, similarSessions,
|
|||
{userCity && (
|
||||
<span className="mr-1">{userCity},</span>
|
||||
)}
|
||||
{userState && (
|
||||
<span className="mr-1">{userState},</span>
|
||||
)}
|
||||
<span>{countries[userCountry]}</span>
|
||||
<span className="mx-1 font-bold text-xl">·</span>
|
||||
<span className="capitalize">
|
||||
|
|
|
|||
|
|
@ -1,22 +1,17 @@
|
|||
import React from 'react';
|
||||
import cn from 'classnames';
|
||||
import { countries } from 'App/constants';
|
||||
import { Icon } from 'UI';
|
||||
import stl from './countryFlag.module.css';
|
||||
|
||||
const CountryFlag = ({
|
||||
userCity = '',
|
||||
userState = '',
|
||||
country = '',
|
||||
className = '',
|
||||
style = {},
|
||||
label = false,
|
||||
width = 22,
|
||||
height = 15,
|
||||
}) => {
|
||||
const knownCountry = !!country && country !== 'UN';
|
||||
const countryFlag = knownCountry ? country.toLowerCase() : '';
|
||||
const countryName = knownCountry ? countries[country] : 'Unknown Country';
|
||||
|
||||
return (
|
||||
<div className="flex items-center" style={style}>
|
||||
|
|
@ -33,9 +28,7 @@ const CountryFlag = ({
|
|||
</div>
|
||||
</div>
|
||||
)}
|
||||
{userCity && <span className="mx-1">{userCity},</span>}
|
||||
{userState && <span className="mr-1">{userState},</span>}
|
||||
{knownCountry && label && <div className={cn(stl.label, 'ml-1')}>{countryName}</div>}
|
||||
{userCity && <span className="mx-1">{userCity}</span>}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue