Click here to Skip to main content
15,795,581 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
export default function UserProfile(props) {
  const { isLoggedIn, user, profile  } = useSelector((state) => state.AuthReducer);
  const { wallet, paired_curency_price, coins, wallet_loading } = useSelector(
    (state) => state.coinDBReducer
  const dispatch = useDispatch();
  const [loading, setLoading] = useState(true);
  const [hide, setHide] = useState(false);
  const [nodisplay, setDisplay] = useState(false);
  const [name, setName] = useState("");
  const [total_btc, setTotalBtc] = useState(0);
  const [total_usdt, setTotalUsdt] = useState(0);
  const updateProfile = (e) => {
    if (checkName(name)) {
        user?.params ? user.params.token: user.token,
      ).then((res) => {
        if (res.status.matchedCount == 1) {
          N_getProfile(user?.params ? user.params.token: user.token)
        .then((d) => {
          if (d.status === 200) {
            dispatch({type:'PROFILE', data:d?.params.profile_info})
        .catch((e) => {
          NotificationManager.success("Updated Successfully");
        } else {
    } else {
      NotificationManager.error("Enter valid nick Name");

  <main className="s-layout__content">
    <div className="container-fluid">
      <div className="account_page">
        <div className="col-lg-12">
          <div className="jambotron">
            <div className="horizontal_display_with_justify">
              <div className="flex_row">
                {" "}
                <div className="name_circle">
                    ? profile?.name
                      .slice(0, 2)
                    : profile?.email
                       .slice(0, 2)
                {" "}
                  ? <><span>Hello</span>
                        onChange={(e) => {
                          setName("/a-zA-z*/i", ""));
                  : <div className="big_heading text-capitalize me-2 text-truncate mob_mw_150">
                      {" "}Hello,{" "}
                        ? "**********"
                        : profile?.name
                        : profile?.email}{" "}
                      {nodisplay ?
                          <div className="d-flex gap-1">
                              className="btn btn-pink btn-sm fs-14"
                              onClick={(e) => {
                        </> : <></>  
                        onClick={() => {

What I have tried:

In this code, inputfield shows the inputfield in when edit cursor shows inputfield. However, my question is when I click edit cursor, it does not show inputfield, only edit at the same place and click update button updates at the same place and edit at the same place, not open new input field. I click edit cursor, edit text does not show inputfield in the browser.
Updated 1-Oct-23 9:20am

This is a very common, so there is lots of documentation, tutorials, and examples on this. Here is a Google search with many answers for you: react working with the input field - Google[^]

Here is the official documentation with examples: <input> – React[^]
Share this answer
flyshivanshu 1-Oct-23 3:22am    
bro plese send solution in this code
Dave Kreskowiak 1-Oct-23 10:27am    
The only code you're ever going to get is the code YOU write. Dropping a bunch of code here and demanding people fix it for you teaches you nothing at all.
bro plese send solution in this code

While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.

So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.

Just dumping a pile of code on us and saying "fix this!" isn't going to get you anywhere.

If you are having problems getting started at all, then this may help: How to Write Code to Solve a Problem, A Beginner's Guide[^]
Share this answer
flyshivanshu 1-Oct-23 3:27am    
at same code please answer me
Richard Deeming 2-Oct-23 4:32am    
You have had your answer, twice: nobody is going to write the code for you.

But by all means, keep demanding that someone else does your work for you and hands it to you on a plate. See how far that gets you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900