Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Jay-byte389/AMS/llms.txt

Use this file to discover all available pages before exploring further.

AMS organises its interface into a set of focused, single-responsibility components that live in src/components/. Each component consumes design tokens from src/constants/colors, Fonts, and spacing — so visual changes propagate automatically across every screen. Components are grouped below by their role in the UI: Buttons, Inputs, Headers, Cards & Lists, Profile, and Notifications.

Buttons

PrimaryButton is the main call-to-action button used on auth and booking screens. It supports two visual variants — primary (solid colors.primary background with white text) and secondary (soft colors.secondary background with colors.primary text) — controlled by the type prop.Props
PropTypeDefaultDescription
titlestringButton label text
onPress() => voidPress handler
type'primary' | 'secondary''primary'Visual variant
import PrimaryButton from '../components/PrimaryButton';

// Primary (solid blue)
<PrimaryButton
  title="Book Appointment"
  onPress={() => navigation.navigate('Booking')}
/>

// Secondary (soft blue)
<PrimaryButton
  title="Cancel"
  type="secondary"
  onPress={() => navigation.goBack()}
/>
ButtonComp is a generic solid button wrapper built on TouchableOpacity. Unlike PrimaryButton, it does not have a secondary variant — it always renders with a colors.primary background. An optional width prop lets you constrain its size; without it the button stretches to full width.Props
PropTypeDefaultDescription
textstringButton label text
onPress() => voidPress handler
widthnumber | string'100%'Optional explicit width; defaults to full width
import ButtonComp from '../components/ButtonComp';

// Full-width (default)
<ButtonComp
  text="Continue"
  onPress={handleContinue}
/>

// Fixed width
<ButtonComp
  text="Save"
  width={200}
  onPress={handleSave}
/>
SocialButton renders a square icon button used for third-party authentication (Google, Facebook, Apple). It displays a provider logo image inside a colors.secondary pill with a subtle shadow. Pass a local require(...) or remote URI as image.Props
PropTypeDefaultDescription
imageImageSourcePropTypeProvider logo (local require or URI object)
onPress() => voidPress handler
import SocialButton from '../components/SocialButton';

<SocialButton
  image={require('../assets/icons/google.png')}
  onPress={handleGoogleLogin}
/>

<SocialButton
  image={require('../assets/icons/apple.png')}
  onPress={handleAppleLogin}
/>
TabButtons is a single pill-shaped tab selector used on appointment list screens to switch between status categories. An active state changes the background to solid #2F5CF5 with white text; the inactive state uses #DCE5FF with #2F5CF5 text.Props
PropTypeDefaultDescription
titlestringTab label (e.g. "Completed", "Upcoming", "Cancelled")
activebooleanWhether this tab is currently selected
onPress() => voidPress handler to switch active tab
import TabButton from '../components/TabButtons';

const [activeTab, setActiveTab] = React.useState('Upcoming');

<View style={{ flexDirection: 'row', gap: 8 }}>
  {['Completed', 'Upcoming', 'Cancelled'].map(tab => (
    <TabButton
      key={tab}
      title={tab}
      active={activeTab === tab}
      onPress={() => setActiveTab(tab)}
    />
  ))}
</View>

Inputs

CustomInput is the standard labelled text field used throughout forms in AMS. It wraps React Native’s TextInput inside a colors.secondary rounded container. Optional leftIcon and rightIcon slots accept any renderable node (SVG, Ionicons, etc.). Outer, container, and inner input styles are all individually overridable via the style, inputContainerStyle, and inputStyle props.Props
PropTypeDefaultDescription
labelstringOptional label rendered above the input
placeholderstringInput placeholder text
valuestringControlled value
onChangeText(text: string) => voidChange handler
secureTextEntrybooleanfalseMasks input (use PasswordInput for a toggle)
keyboardTypeKeyboardTypeOptions'default'Numeric, email, phone, etc.
leftIconReactNodeIcon rendered on the left side
rightIconReactNodeIcon rendered on the right side
editablebooleantrueWhether the field is editable
placeholderTextColorstringPlaceholder text color override
multilinebooleanfalseEnables multiline mode
numberOfLinesnumber1Number of lines when multiline is true
textAlignVerticalstring'center'Vertical text alignment inside the field
styleStyleProp<ViewStyle>Overrides the outermost wrapper style
inputContainerStyleStyleProp<ViewStyle>Overrides the inner container row style
inputStyleStyleProp<TextStyle>Overrides the TextInput style
import CustomInput from '../components/CustomInput';
import Ionicons from 'react-native-vector-icons/Ionicons';

<CustomInput
  label="Email Address"
  placeholder="you@example.com"
  value={email}
  onChangeText={setEmail}
  keyboardType="email-address"
  leftIcon={<Ionicons name="mail-outline" size={18} color={colors.primary} />}
/>

// Multiline notes field
<CustomInput
  label="Reason for visit"
  placeholder="Describe your symptoms..."
  value={notes}
  onChangeText={setNotes}
  multiline
  numberOfLines={4}
  textAlignVertical="top"
/>
PasswordInput is a specialised password field that manages its own show/hide toggle state. Pressing the eye icon switches the secureTextEntry value between true and false, showing eye-off-outline or eye-outline from Ionicons accordingly. It uses colors.secondary as its background, colors.input (#60A5FA) for typed text and placeholder text, and colors.grey for the toggle icon.Props
PropTypeDefaultDescription
valuestringControlled value
onChangeText(text: string) => voidChange handler
placeholderstringPlaceholder text
import PasswordInput from '../components/PasswordManager/PasswordInput';

<PasswordInput
  placeholder="Enter your password"
  value={password}
  onChangeText={setPassword}
/>
PaymentInput is a selectable payment method row used on the payment screen. Each row shows a provider icon on the left and a radio-button indicator on the right (composed of OuterCircle and InnerCircle SVGs). When the selected value matches the row’s text, InnerCircle fills with colors.primary. A 500 ms setTimeout delay fires the onPress callback after the selection animation settles.Props
PropTypeDefaultDescription
textstringPayment method name (also used as the selection key)
iconReactNodeProvider logo or icon rendered on the left
selectedstringCurrently selected method name
setSelected(text: string) => voidUpdates the parent selection state
onPress() => voidCalled 500 ms after the row is tapped
import PaymentInput from '../components/PaymentInput';
import VisaIcon from '../assets/icons/Visa.svg';

const [selectedMethod, setSelectedMethod] = React.useState('');

<PaymentInput
  text="Visa Card"
  icon={<VisaIcon width={28} height={28} />}
  selected={selectedMethod}
  setSelected={setSelectedMethod}
  onPress={() => navigation.navigate('AddCard')}
/>

<PaymentInput
  text="Apple Pay"
  icon={<ApplePayIcon width={28} height={28} />}
  selected={selectedMethod}
  setSelected={setSelectedMethod}
  onPress={() => handleApplePay()}
/>

Headers

Headers (exported as Header) is the general-purpose screen header. It renders a centred title with an optional back button on the left and a configurable right slot. The back button calls navigation.goBack() by default, but this can be overridden with onBackPress. The right slot accepts either a built-in settings icon or a fully custom rightComponent.Props
PropTypeDefaultDescription
titlestringScreen title (centred, truncated to 1 line)
showBackButtonbooleantrueShows the chevron-back Ionicon on the left
showRightIconbooleanfalseShows a settings icon on the right when no rightComponent is provided
onBackPress() => voidCustom back handler; falls back to navigation.goBack()
onRightPress() => voidCallback for the built-in right settings icon
rightComponentReactNodeFully replaces the right slot with any component
import Header from '../components/Headers';

// Standard back-button header
<Header title="Appointment Details" />

// Header with custom right action
<Header
  title="My Profile"
  showRightIcon
  onRightPress={() => navigation.navigate('Settings')}
/>

// Header with custom right component
<Header
  title="Doctors"
  rightComponent={
    <TouchableOpacity onPress={openFilter}>
      <FilterIcon />
    </TouchableOpacity>
  }
/>
DoctorsHeader is the specialised header shown on the doctor listing screen. It combines a back button, a title, search and filter icon buttons (top row), and a sort bar with five sort modes (bottom row). The sort bar uses a controlled selectedTab index: 0 = A→Z alphabetical, 1 = top-rated (Star), 2 = favourited (Heart), 3 = female doctors (Venus), 4 = male doctors (Mars). The active sort chip renders with a colors.primary background.Props
PropTypeDefaultDescription
titlestringScreen title displayed in the top row
selectedTabnumberActive sort tab index (0–4)
setSelectedTab(index: number) => voidUpdates sort selection in parent state
import DoctorsHeader from '../components/DoctorsHeader';

const [sortTab, setSortTab] = React.useState(0);

<DoctorsHeader
  title="All Doctors"
  selectedTab={sortTab}
  setSelectedTab={setSortTab}
/>
HomeHeaders is the app’s home screen header. It loads the logged-in user’s fullName from getLoggedInUser() (async, stored locally) and displays a welcome greeting alongside a profile avatar image. The right side provides two icon buttons: one navigating to NotificationScreen and one for settings.PropsHomeHeaders accepts no external props — user data and navigation are resolved internally.
import HomeHeaders from '../components/HomeHeaders';

// Drop in at the top of the Home screen
<HomeHeaders />
User name is fetched asynchronously on mount. The component shows an empty string until the storage call resolves, then switches to 'Guest' if no fullName is found.
ScheduleHeader is the header for the doctor info / appointment scheduling screen. It can render in two modes controlled by showSchedule:
  • Doctor mode (showSchedule={false}, default): shows the doctor’s name and qualification inside a colors.primary pill.
  • Schedule mode (showSchedule={true}): shows a “Schedule” badge with a calendar icon.
Both modes display Phone, Video, and Chat icon action buttons in the centre row, and a question mark and filled heart icon on the far right.Props
PropTypeDefaultDescription
titlestringDoctor’s name
qualificationstringDoctor’s qualification (appended after title)
onBack() => voidBack button press handler
showSchedulebooleanfalseSwitches between doctor-name and schedule-badge modes
import ScheduleHeader from '../components/ScheduleHeader';

// Doctor info mode
<ScheduleHeader
  title="Dr. Sarah Jones"
  qualification=", MD"
  onBack={() => navigation.goBack()}
/>

// Scheduling mode
<ScheduleHeader
  title="Dr. Sarah Jones"
  qualification=", MD"
  onBack={() => navigation.goBack()}
  showSchedule
/>

Cards & Lists

DoctorCard renders a vertically scrollable FlatList of doctor summary cards. Each card shows the doctor’s avatar image, name, qualification, department, an “Info” button that navigates to the Info screen, and four action icon buttons (Calendar, Direct, QuestionMark, Heart). The component is self-contained — it owns the FlatList and scroll behaviour.Props
PropTypeDefaultDescription
doctorsDoctor[]Array of doctor objects; each must have id, avatar, name, qualification, and department
navigationNavigationPropReact Navigation prop used to navigate to 'Info'
import DoctorCard from '../components/DoctorCard';

<DoctorCard
  doctors={doctorsList}
  navigation={navigation}
/>
DoctorCard renders its own FlatList. Do not nest it inside another FlatList or ScrollView to avoid the VirtualizedList nesting warning.
RatingCard renders a FlatList of doctor cards sorted by ratings. Each card has a top row with the doctor’s avatar, a “Professional Doctor” badge, the doctor’s name and department inside a white rounded box, and a star + rating chip on the far right. The bottom row has an Info button and Calendar, QuestionMark, and Heart icon buttons.Props
PropTypeDefaultDescription
doctorsDoctor[]Array of doctor objects; each must have id, avatar, name, department, and ratings
navigationNavigationPropReact Navigation prop used to navigate to 'Info'
import RatingCard from '../components/RatingCard';

// Typically used when the sort tab is set to "Top Rated"
<RatingCard
  doctors={sortedByRating}
  navigation={navigation}
/>
Favourites is a scrollable component that switches between a Doctors tab and a Services tab via internal tab pills. In Doctors mode it reads favouriteIds from the doctors Redux slice and dispatches toggleFavourtie to add or remove a doctor. Each doctor card shows an avatar, “Professional Doctor” label, name/department info, and a “Make Appointment” button. In Services mode it renders collapsible department rows with a “Looking Doctors” CTA.Props
PropTypeDefaultDescription
favoriteTab'DOCTORS' | 'SERVICES'Active tab controlled by parent
setFavoriteTab(tab: string) => voidSwitches the active tab
displayDoctorsDoctor[]Full doctor array (filtered internally by favouriteIds)
servicesService[]Services array; each item must have a department field
expandedServicestring | nullDepartment name of the currently expanded service row
setExpandedService(dept: string | null) => voidToggles the expanded service row
navigationNavigationPropUsed to navigate to 'Info' and 'DepartmentDoctors'
import Favourties from '../components/Favourites';

const [tab, setTab] = React.useState('DOCTORS');
const [expandedService, setExpandedService] = React.useState(null);

<Favourties
  favoriteTab={tab}
  setFavoriteTab={setTab}
  displayDoctors={doctors}
  services={services}
  expandedService={expandedService}
  setExpandedService={setExpandedService}
  navigation={navigation}
/>

Profile

ProfileAvatar displays the user’s profile picture (a static local asset Profileuser.png) with a circular edit button overlay in the bottom-right corner. Below the image it renders the user’s full name, fetched asynchronously from getLoggedInUser() on mount. It accepts no external props.
import ProfileAvatar from '../components/ProfileAvatar';

// Place at the top of the Profile screen
<ProfileAvatar />
The edit button renders a pencil icon (create-outline from Ionicons) but does not currently wire to an edit action — connect onPress at the component level if edit-photo navigation is needed.
ProfileMenuList is a self-contained list that composes all ProfileMenuItem rows for the Profile screen. It manages its own logout confirmation modal (a bottom sheet) and handles navigation to EditProfile, Payment, Settings, PrivacyPolicy, and HelpCenter. On logout it dispatches logoutUser (thunk), shows a success snackbar via showSnackbar, and replaces the navigation stack to Auth → Login.PropsProfileMenuList accepts no external props — all navigation and Redux dispatch are handled internally.
import ProfileMenuList from '../components/ProfileMenuList';

// Renders the complete profile menu including logout confirmation modal
<ProfileMenuList />
ProfileMenuList relies on a Redux store with auth and snackbar slices and React Navigation context. It must be rendered inside Provider and NavigationContainer.
ProfileMenuItems (exported as ProfileMenuItem) is a single tappable row for the profile menu. It renders a circular icon badge (filled with colors.secondary) on the left, a text label, and an optional chevron-forward icon on the right. icon expects an Ionicons icon name string.Props
PropTypeDefaultDescription
iconstringIonicons icon name (e.g. 'person-outline', 'card-outline')
titlestringRow label text
onPress() => voidTap handler
showChevronbooleantrueWhether to show the right-side chevron arrow
import ProfileMenuItem from '../components/ProfileMenuItems';

<ProfileMenuItem
  icon="person-outline"
  title="Edit Profile"
  onPress={() => navigation.navigate('EditProfile')}
/>

// No chevron for destructive actions
<ProfileMenuItem
  icon="log-out-outline"
  title="Logout"
  showChevron={false}
  onPress={handleLogout}
/>
SettingsItem is a single settings row with a custom icon node on the left, a text label, and a fixed chevron-forward Ionicon on the right. Unlike ProfileMenuItems, the icon slot accepts any ReactNode — pass an SVG, image, or icon component directly rather than an icon name string.Props
PropTypeDefaultDescription
iconReactNodeIcon rendered on the left (any renderable node)
titlestringRow label text
onPress() => voidTap handler
import SettingsItem from '../components/SettingsItem';
import NotificationIcon from '../assets/icons/Notification.svg';
import LockIcon from '../assets/icons/Lock.svg';

<SettingsItem
  icon={<NotificationIcon width={20} height={20} />}
  title="Notifications"
  onPress={() => navigation.navigate('NotificationSettings')}
/>

<SettingsItem
  icon={<LockIcon width={20} height={20} />}
  title="Change Password"
  onPress={() => navigation.navigate('ChangePassword')}
/>

Notifications

GlobalSnackbar is a floating, swipe-dismissible notification bar mounted once at the app root. It subscribes to the snackbar Redux slice (visible, message, type) and animates in from the right edge using Animated.spring. After 2000 ms it auto-dismisses with a slide-out animation. Users can also swipe it away horizontally (left or right) using the built-in PanResponder — a swipe past 30% of screen width or a velocity above 0.7 triggers dismissal. Background colour is determined by type:
typeColor
'success'#4CAF50 (green)
'error'#FF4D4F (red)
'warning' (default)#FFA500 (orange)
PropsGlobalSnackbar takes no props — all state comes from the Redux snackbar slice.Redux integrationDispatch showSnackbar from snackBarSlice to trigger the bar:
import { showSnackbar } from '../redux/slices/snackBarSlice';

// Trigger from anywhere in the app
dispatch(showSnackbar({ message: 'Appointment booked!', type: 'success' }));
dispatch(showSnackbar({ message: 'Something went wrong', type: 'error' }));
dispatch(showSnackbar({ message: 'Check your connection', type: 'warning' }));
MountingMount GlobalSnackbar once at the root of your navigator tree so it floats above all screens:
import GlobalSnackbar from '../components/GlobalSnackbar';

export default function App() {
  return (
    <Provider store={store}>
      <NavigationContainer>
        <RootNavigator />
        {/* Renders above all screens */}
        <GlobalSnackbar />
      </NavigationContainer>
    </Provider>
  );
}
GlobalSnackbar uses useSafeAreaInsets to position itself above the device’s home indicator, so it will never be hidden behind the bottom navigation bar on notched devices.

Build docs developers (and LLMs) love