A disbelievers good deeds weigh nothing on the day of judgment, but what if a person lives a part of his life as a disbeliever and another, latter part as a believer. What about the good deeds they did when they were a disbeliever?
Assalam O Alaikum Wa Rahmatullahi Wa Barakatuhu Sister,
Allah says in the Quran, Surah 25:70
إِلَّا مَن تَابَ وَءَامَنَ وَعَمِلَ عَمَلًا صَٰلِحًا فَأُو۟لَٰٓئِكَ يُبَدِّلُ ٱللَّهُ سَيِّـَٔاتِهِمْ حَسَنَٰتٍ وَكَانَ ٱللَّهُ غَفُورًا رَّحِيمًا
Interpretation of the meaning: Except those who repent and believe (in Islamic Monotheism), and do righteous deeds, for those,
Allah will change their sins into good deeds, and Allah is Oft-Forgiving, Most Merciful.
[Quran 25:70]
Allah is so Merciful. Not only does He erases the sins of disbelievers when they accept Islam, but He also replaces the evil deeds with good. If Allah replaces evil deeds with good, I am sure all good deeds such as giving charity etc. done before becoming Muslim will also be accepted. This is further clarified in a hadith which I will quote below:
Hakim b. Hizam reported to 'Urwa b. Zubair that he said to the Messenger of Allah (ﷺ):
Messenger of Allah, do you think if there is any reward (of the Lord with me on the Day of Resurrection) for the deeds of religious purification that I performed in the state of ignorance, such as charity, freeing a slave, cementing of blood-relations? Upon this he (the Messenger of Allah) said to him: You have accepted Islam with all the previous virtues that you had practiced.
وَحَدَّثَنَا حَسَنٌ الْحُلْوَانِيُّ، وَعَبْدُ بْنُ حُمَيْدٍ، - قَالَ الْحُلْوَانِيُّ حَدَّثَنَا وَقَالَ عَبْدٌ، حَدَّثَنِي - يَعْقُوبُ، - وَهُوَ ابْنُ إِبْرَاهِيمَ بْنِ سَعْدٍ - حَدَّثَنَا أَبِي، عَنْ صَالِحٍ، عَنِ ابْنِ شِهَابٍ، قَالَ أَخْبَرَنِي عُرْوَةُ بْنُ الزُّبَيْرِ، أَنَّ حَكِيمَ بْنَ حِزَامٍ، أَخْبَرَهُ أَنَّهُ، قَالَ لِرَسُولِ اللَّهِ صلى الله عليه وسلم أَىْ رَسُولَ اللَّهِ أَرَأَيْتَ أُمُورًا كُنْتُ أَتَحَنَّثُ بِهَا فِي الْجَاهِلِيَّةِ مِنْ صَدَقَةٍ أَوْ عَتَاقَةٍ أَوْ صِلَةِ رَحِمٍ أَفِيهَا أَجْرٌ فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " أَسْلَمْتَ عَلَى مَا أَسْلَفْتَ مِنْ خَيْرٍ " .
Reference:
Sahih Muslim 123 b
In-book reference: Book 1, Hadith 231
USC-MSA web (English) reference: Book 1, Hadith 223
https://sunnah.com/muslim/1/231
And Allah knows the best!
Ma'aSalaam